aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/codegen
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2018-03-09 14:45:43 -0800
committerGravatar Alexander Polcyn <apolcyn@google.com>2018-03-09 14:45:43 -0800
commitf1332596174c45bd4b0b0d80a9a05827b01cfa0f (patch)
tree1f3f5f1d5c93331d5dd9f5b46668602109a24e46 /test/cpp/codegen
parent2e251697b1991537f463e26afff71a561a732f58 (diff)
Fix broken golden file test under bazel
Diffstat (limited to 'test/cpp/codegen')
-rw-r--r--test/cpp/codegen/BUILD18
-rwxr-xr-xtest/cpp/codegen/run_golden_file_test.sh6
2 files changed, 19 insertions, 5 deletions
diff --git a/test/cpp/codegen/BUILD b/test/cpp/codegen/BUILD
index 1388dbc650..12712a3e6c 100644
--- a/test/cpp/codegen/BUILD
+++ b/test/cpp/codegen/BUILD
@@ -61,7 +61,6 @@ grpc_cc_binary(
srcs = ["golden_file_test.cc"],
deps = [
"//:grpc++",
- "//src/proto/grpc/testing:compiler_test_proto",
"//test/core/util:gpr_test_util",
],
external_deps = [
@@ -70,6 +69,20 @@ grpc_cc_binary(
],
)
+genrule(
+ name = "copy_compiler_test_grpc_pb_h",
+ srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
+ cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.h > $@",
+ outs = ["compiler_test.grpc.pb.h"],
+)
+
+genrule(
+ name = "copy_compiler_test_mock_grpc_pb_h",
+ srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
+ cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test_mock.grpc.pb.h > $@",
+ outs = ["compiler_test_mock.grpc.pb.h"],
+)
+
grpc_sh_test(
name = "run_golden_file_test",
srcs = ["run_golden_file_test.sh"],
@@ -77,6 +90,7 @@ grpc_sh_test(
":golden_file_test",
":compiler_test_golden",
":compiler_test_mock_golden",
- "//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen",
+ ":compiler_test.grpc.pb.h",
+ ":compiler_test_mock.grpc.pb.h",
],
)
diff --git a/test/cpp/codegen/run_golden_file_test.sh b/test/cpp/codegen/run_golden_file_test.sh
index cdfaa96a1c..8fe801c876 100755
--- a/test/cpp/codegen/run_golden_file_test.sh
+++ b/test/cpp/codegen/run_golden_file_test.sh
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-set -ex
+set -eux
-GENERATED_FILES_PATH="$TEST_SRCDIR/../../../../../genfiles/src/proto/grpc/testing/"
-test/cpp/codegen/golden_file_test --generated_file_path="$GENERATED_FILES_PATH"
+GENERATED_PB_H_DIR="${TEST_SRCDIR}/com_github_grpc_grpc/test/cpp/codegen/"
+test/cpp/codegen/golden_file_test --generated_file_path="$GENERATED_PB_H_DIR"