16 #include "tensorflow_serving/test_util/test_util.h"
20 #include "tensorflow/core/lib/io/path.h"
21 #include "tensorflow/core/platform/env.h"
22 #include "tensorflow/core/platform/test.h"
23 #include "tsl/platform/protobuf.h"
25 namespace tensorflow {
29 string TensorflowTestSrcDirPath(
const string& relative_path) {
30 const string base_path = tensorflow::io::JoinPath(
31 getenv(
"TEST_SRCDIR"),
32 "tf_serving/external/org_tensorflow/tensorflow/");
33 return tensorflow::io::JoinPath(base_path, relative_path);
36 string TestSrcDirPath(
const string& relative_path) {
37 const string base_path = tensorflow::io::JoinPath(
38 getenv(
"TEST_SRCDIR"),
"tf_serving/tensorflow_serving");
39 return tensorflow::io::JoinPath(base_path, relative_path);
42 ProtoStringMatcher::ProtoStringMatcher(
const string& expected)
43 : expected_(expected) {}
44 ProtoStringMatcher::ProtoStringMatcher(
const google::protobuf::Message& expected)
45 : expected_([&]() -> std::string {
47 tsl::protobuf::TextFormat::PrintToString(expected, &result);