Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
workspace(name = "tf_serving")

local_repository(
name = "tf",
path = __workspace_dir__ + "/tensorflow",
Expand Down
10 changes: 10 additions & 0 deletions tensorflow_serving/test_util/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,23 @@ limitations under the License.
#include "tensorflow_serving/test_util/test_util.h"

#include "tensorflow/core/lib/io/path.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/test.h"

namespace tensorflow {
namespace serving {
namespace test_util {

string TestSrcDirPath(const string& relative_path) {
const string base_path = tensorflow::io::JoinPath(
getenv("TEST_SRCDIR"),
"tf_serving/tensorflow_serving");
if (Env::Default()->FileExists(base_path)) {
// Supported in Bazel 0.2.2+.
return tensorflow::io::JoinPath(base_path, relative_path);
}
// Old versions of Bazel sometimes don't include the workspace name in the
// runfiles path.
return tensorflow::io::JoinPath(
tensorflow::io::JoinPath(getenv("TEST_SRCDIR"),
"tensorflow_serving"),
Expand Down