• 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_test", "grpc_cc_binary")
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            "gmock",
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            "//test/core/util:gpr_test_util",
32            "//:grpc++%s" % unsecure_build_config_suffix,
33            "//:grpc%s" % unsecure_build_config_suffix,
34            "//:gpr",
35            "//test/cpp/util:test_config",
36        ],
37    )
38    # meant to be invoked only through the top-level shell script driver
39    grpc_cc_binary(
40        name = "resolver_component_test%s" % unsecure_build_config_suffix,
41        testonly = 1,
42        srcs = [
43            "resolver_component_test.cc",
44        ],
45        external_deps = [
46            "gmock",
47        ],
48        deps = [
49            "//test/cpp/util:test_util%s" % unsecure_build_config_suffix,
50            "//test/core/util:grpc_test_util%s" % unsecure_build_config_suffix,
51            "//test/core/util:gpr_test_util",
52            "//:grpc++%s" % unsecure_build_config_suffix,
53            "//:grpc%s" % unsecure_build_config_suffix,
54            "//:gpr",
55            "//test/cpp/util:test_config",
56        ],
57    )
58    grpc_cc_test(
59        name = "resolver_component_tests_runner_invoker%s" % unsecure_build_config_suffix,
60        srcs = [
61            "resolver_component_tests_runner_invoker.cc",
62        ],
63        deps = [
64            "//test/cpp/util:test_util",
65            "//test/core/util:grpc_test_util",
66            "//test/core/util:gpr_test_util",
67            "//:grpc++",
68            "//:grpc",
69            "//:gpr",
70            "//test/cpp/util:test_config",
71        ],
72        data = [
73            ":resolver_component_tests_runner",
74            ":resolver_component_test%s" % unsecure_build_config_suffix,
75            "//test/cpp/naming/utils:dns_server",
76            "//test/cpp/naming/utils:dns_resolver",
77            "//test/cpp/naming/utils:tcp_connect",
78            "resolver_test_record_groups.yaml", # include the transitive dependency so that the dns sever py binary can locate this
79        ],
80        args = [
81            "--test_bin_name=resolver_component_test%s" % unsecure_build_config_suffix,
82            "--running_under_bazel=true",
83        ]
84    )
85