blob: 12712a3e6c846afa1436b30d546e6b34ce4e581b [file] [log] [blame]
Jan Tattermusch7897ae92017-06-07 22:57:36 +02001# Copyright 2017 gRPC authors.
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -08002#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003# 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
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -08006#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02007# http://www.apache.org/licenses/LICENSE-2.0
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -08008#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009# 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.
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080014
Jan Tattermusch4d5c3102017-06-07 10:23:56 +020015licenses(["notice"]) # Apache v2
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080016
Alexander Polcyn2830e3a2017-12-11 19:15:14 -080017load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_package", "grpc_cc_binary", "grpc_sh_test")
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020018
Nicolas "Pixel" Noble2bc5e3a2017-08-15 22:32:52 +020019grpc_package(name = "test/cpp/codegen")
Nicolas "Pixel" Nobleaf6c83f2017-05-19 00:38:10 +020020
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020021grpc_cc_test(
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080022 name = "codegen_test_full",
23 srcs = ["codegen_test_full.cc"],
24 deps = [
25 "//:grpc++",
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080026 "//test/core/util:gpr_test_util",
27 ],
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020028 external_deps = [
29 "gtest",
30 ],
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080031)
32
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020033grpc_cc_test(
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080034 name = "codegen_test_minimal",
35 srcs = ["codegen_test_minimal.cc"],
36 deps = [
37 "//:grpc++",
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080038 "//test/core/util:gpr_test_util",
39 ],
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020040 external_deps = [
41 "gtest",
42 ],
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080043)
44
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020045grpc_cc_test(
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080046 name = "proto_utils_test",
47 srcs = ["proto_utils_test.cc"],
48 deps = [
49 "//:grpc++",
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080050 "//test/core/util:gpr_test_util",
51 ],
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020052 external_deps = [
53 "gtest",
Vijay Pai5e7ceeb2017-11-03 22:37:03 +000054 "protobuf",
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020055 ],
David Garcia Quintaseb4c47e2017-02-17 15:41:20 -080056)
David Garcia Quintase8543572017-02-21 10:44:02 -080057
Alexander Polcyn2830e3a2017-12-11 19:15:14 -080058grpc_cc_binary(
David Garcia Quintase8543572017-02-21 10:44:02 -080059 name = "golden_file_test",
Alexander Polcynd3dbc0d2017-12-19 16:04:00 -080060 testonly = True,
David Garcia Quintase8543572017-02-21 10:44:02 -080061 srcs = ["golden_file_test.cc"],
David Garcia Quintase8543572017-02-21 10:44:02 -080062 deps = [
63 "//:grpc++",
David Garcia Quintase8543572017-02-21 10:44:02 -080064 "//test/core/util:gpr_test_util",
65 ],
Nicolas "Pixel" Noble7c26eed2017-04-13 01:40:54 +020066 external_deps = [
67 "gtest",
68 "gflags",
69 ],
David Garcia Quintase8543572017-02-21 10:44:02 -080070)
Alexander Polcyn2830e3a2017-12-11 19:15:14 -080071
Alexander Polcynf1332592018-03-09 14:45:43 -080072genrule(
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
Alexander Polcyn2830e3a2017-12-11 19:15:14 -080086grpc_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",
Alexander Polcynf1332592018-03-09 14:45:43 -080093 ":compiler_test.grpc.pb.h",
94 ":compiler_test_mock.grpc.pb.h",
Alexander Polcyn2830e3a2017-12-11 19:15:14 -080095 ],
96)