• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python2.7
2# Copyright 2015 gRPC authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16load("//bazel:grpc_build_system.bzl", "grpc_cc_binary", "grpc_cc_test")
17
18def generate_resolver_component_tests():
19    for unsecure_build_config_suffix in ["_unsecure", ""]:
20        grpc_cc_test(
21            name = "address_sorting_test%s" % unsecure_build_config_suffix,
22            srcs = [
23                "address_sorting_test.cc",
24            ],
25            external_deps = [
26                "gtest",
27            ],
28            deps = [
29                "//test/cpp/util:test_util%s" % unsecure_build_config_suffix,
30                "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix,
31                "//:grpc++%s" % unsecure_build_config_suffix,
32                "//:grpc%s" % unsecure_build_config_suffix,
33                "//:gpr",
34                "//test/cpp/util:test_config",
35            ],
36            tags = ["no_windows"],
37        )
38
39        # meant to be invoked only through the top-level shell script driver
40        grpc_cc_binary(
41            name = "resolver_component_test%s" % unsecure_build_config_suffix,
42            testonly = 1,
43            srcs = [
44                "resolver_component_test.cc",
45            ],
46            external_deps = [
47                "gtest",
48            ],
49            deps = [
50                ":dns_test_util",
51                "//test/cpp/util:test_util%s" % unsecure_build_config_suffix,
52                "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix,
53                "//:grpc++%s" % unsecure_build_config_suffix,
54                "//:grpc%s" % unsecure_build_config_suffix,
55                "//:gpr",
56                "//test/cpp/util:test_config",
57            ],
58            tags = ["no_windows"],
59        )
60        grpc_cc_test(
61            name = "resolver_component_tests_runner_invoker%s" % unsecure_build_config_suffix,
62            srcs = [
63                "resolver_component_tests_runner_invoker.cc",
64            ],
65            deps = [
66                "//test/cpp/util:test_util",
67                "//test/core/util:grpc_test_util",
68                "//:grpc++",
69                "//:grpc",
70                "//:gpr",
71                "//test/cpp/util:test_config",
72            ],
73            data = [
74                ":resolver_component_tests_runner",
75                ":resolver_component_test%s" % unsecure_build_config_suffix,
76                "//test/cpp/naming/utils:dns_server",
77                "//test/cpp/naming/utils:dns_resolver",
78                "//test/cpp/naming/utils:tcp_connect",
79                "resolver_test_record_groups.yaml",  # include the transitive dependency so that the dns sever py binary can locate this
80            ],
81            args = [
82                "--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix,
83                "--running_under_bazel=true",
84            ],
85            tags = ["no_windows", "no_mac"],
86        )
87