1# Copyright 2017 gRPC authors. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15licenses(["notice"]) # Apache v2 16 17load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_test", "grpc_package", "grpc_sh_test") 18 19grpc_package(name = "test/cpp/codegen") 20 21grpc_cc_test( 22 name = "codegen_test_full", 23 srcs = ["codegen_test_full.cc"], 24 external_deps = [ 25 "gtest", 26 ], 27 uses_polling = False, 28 deps = [ 29 "//:grpc++", 30 "//test/core/util:grpc_test_util", 31 ], 32) 33 34grpc_cc_test( 35 name = "codegen_test_minimal", 36 srcs = ["codegen_test_minimal.cc"], 37 external_deps = [ 38 "gtest", 39 ], 40 uses_polling = False, 41 deps = [ 42 "//:grpc++", 43 "//test/core/util:grpc_test_util", 44 ], 45) 46 47grpc_cc_test( 48 name = "proto_utils_test", 49 srcs = ["proto_utils_test.cc"], 50 external_deps = [ 51 "gtest", 52 "protobuf", 53 ], 54 uses_polling = False, 55 deps = [ 56 "//:grpc++", 57 "//test/core/util:grpc_test_util", 58 ], 59) 60 61grpc_cc_binary( 62 name = "golden_file_test", 63 testonly = True, 64 srcs = ["golden_file_test.cc"], 65 external_deps = [ 66 "gtest", 67 "gflags", 68 ], 69 deps = [ 70 "//:grpc++", 71 "//test/core/util:grpc_test_util", 72 "//test/cpp/util:test_config", 73 ], 74) 75 76genrule( 77 name = "copy_compiler_test_grpc_pb_h", 78 srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"], 79 outs = ["compiler_test.grpc.pb.h"], 80 cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.h > $@", 81) 82 83genrule( 84 name = "copy_compiler_test_mock_grpc_pb_h", 85 srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"], 86 outs = ["compiler_test_mock.grpc.pb.h"], 87 cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test_mock.grpc.pb.h > $@", 88) 89 90grpc_sh_test( 91 name = "run_golden_file_test", 92 srcs = ["run_golden_file_test.sh"], 93 data = [ 94 ":compiler_test.grpc.pb.h", 95 ":compiler_test_golden", 96 ":compiler_test_mock.grpc.pb.h", 97 ":compiler_test_mock_golden", 98 ":golden_file_test", 99 ], 100) 101