Imported Upstream version 1.21.0
[platform/upstream/grpc.git] / test / cpp / codegen / BUILD
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
15 licenses(["notice"])  # Apache v2
16
17 load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package", "grpc_cc_binary", "grpc_sh_test")
18
19 grpc_package(name = "test/cpp/codegen")
20
21 grpc_cc_test(
22     name = "codegen_test_full",
23     srcs = ["codegen_test_full.cc"],
24     external_deps = [
25         "gtest",
26     ],
27     deps = [
28         "//:grpc++",
29         "//test/core/util:grpc_test_util",
30     ],
31 )
32
33 grpc_cc_test(
34     name = "codegen_test_minimal",
35     srcs = ["codegen_test_minimal.cc"],
36     external_deps = [
37         "gtest",
38     ],
39     deps = [
40         "//:grpc++",
41         "//test/core/util:grpc_test_util",
42     ],
43 )
44
45 grpc_cc_test(
46     name = "proto_utils_test",
47     srcs = ["proto_utils_test.cc"],
48     external_deps = [
49         "gtest",
50         "protobuf",
51     ],
52     deps = [
53         "//:grpc++",
54         "//test/core/util:grpc_test_util",
55     ],
56 )
57
58 grpc_cc_binary(
59     name = "golden_file_test",
60     testonly = True,
61     srcs = ["golden_file_test.cc"],
62     external_deps = [
63         "gtest",
64         "gflags",
65     ],
66     deps = [
67         "//:grpc++",
68         "//test/core/util:grpc_test_util",
69         "//test/cpp/util:test_config",
70     ],
71 )
72
73 genrule(
74     name = "copy_compiler_test_grpc_pb_h",
75     srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
76     outs = ["compiler_test.grpc.pb.h"],
77     cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.h > $@",
78 )
79
80 genrule(
81     name = "copy_compiler_test_mock_grpc_pb_h",
82     srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
83     outs = ["compiler_test_mock.grpc.pb.h"],
84     cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test_mock.grpc.pb.h > $@",
85 )
86
87 grpc_sh_test(
88     name = "run_golden_file_test",
89     srcs = ["run_golden_file_test.sh"],
90     data = [
91         ":compiler_test.grpc.pb.h",
92         ":compiler_test_golden",
93         ":compiler_test_mock.grpc.pb.h",
94         ":compiler_test_mock_golden",
95         ":golden_file_test",
96     ],
97 )