• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_test", "grpc_package", "grpc_cc_binary", "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    deps = [
25        "//:grpc++",
26        "//test/core/util:gpr_test_util",
27    ],
28    external_deps = [
29        "gtest",
30    ],
31)
32
33grpc_cc_test(
34    name = "codegen_test_minimal",
35    srcs = ["codegen_test_minimal.cc"],
36    deps = [
37        "//:grpc++",
38        "//test/core/util:gpr_test_util",
39    ],
40    external_deps = [
41        "gtest",
42    ],
43)
44
45grpc_cc_test(
46    name = "proto_utils_test",
47    srcs = ["proto_utils_test.cc"],
48    deps = [
49        "//:grpc++",
50        "//test/core/util:gpr_test_util",
51    ],
52    external_deps = [
53        "gtest",
54        "protobuf",
55    ],
56)
57
58grpc_cc_binary(
59    name = "golden_file_test",
60    testonly = True,
61    srcs = ["golden_file_test.cc"],
62    deps = [
63        "//:grpc++",
64        "//test/core/util:gpr_test_util",
65    ],
66    external_deps = [
67        "gtest",
68        "gflags",
69    ],
70)
71
72genrule(
73    name = "copy_compiler_test_grpc_pb_h",
74    srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
75    cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.h > $@",
76    outs = ["compiler_test.grpc.pb.h"],
77)
78
79genrule(
80    name = "copy_compiler_test_mock_grpc_pb_h",
81    srcs = ["//src/proto/grpc/testing:_compiler_test_proto_grpc_codegen"],
82    cmd = "cat $(GENDIR)/src/proto/grpc/testing/compiler_test_mock.grpc.pb.h > $@",
83    outs = ["compiler_test_mock.grpc.pb.h"],
84)
85
86grpc_sh_test(
87    name = "run_golden_file_test",
88    srcs = ["run_golden_file_test.sh"],
89    data = [
90        ":golden_file_test",
91        ":compiler_test_golden",
92        ":compiler_test_mock_golden",
93        ":compiler_test.grpc.pb.h",
94        ":compiler_test_mock.grpc.pb.h",
95    ],
96)
97