aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/codegen/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/codegen/BUILD')
-rw-r--r--test/cpp/codegen/BUILD37
1 files changed, 29 insertions, 8 deletions
diff --git a/test/cpp/codegen/BUILD b/test/cpp/codegen/BUILD
index 6cc81e3398..12712a3e6c 100644
--- a/test/cpp/codegen/BUILD
+++ b/test/cpp/codegen/BUILD
@@ -14,7 +14,7 @@
licenses(["notice"]) # Apache v2
-load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package")
+load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package", "grpc_cc_binary", "grpc_sh_test")
grpc_package(name = "test/cpp/codegen")
@@ -55,17 +55,12 @@ grpc_cc_test(
],
)
-grpc_cc_test(
+grpc_cc_binary(
name = "golden_file_test",
+ testonly = True,
srcs = ["golden_file_test.cc"],
- args = ["--generated_file_path=$(GENDIR)/src/proto/grpc/testing/"],
- data = [
- ":compiler_test_golden",
- "//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen",
- ],
deps = [
"//:grpc++",
- "//src/proto/grpc/testing:compiler_test_proto",
"//test/core/util:gpr_test_util",
],
external_deps = [
@@ -73,3 +68,29 @@ grpc_cc_test(
"gflags",
],
)
+
+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"],
+ data = [
+ ":golden_file_test",
+ ":compiler_test_golden",
+ ":compiler_test_mock_golden",
+ ":compiler_test.grpc.pb.h",
+ ":compiler_test_mock.grpc.pb.h",
+ ],
+)