Debian Codegraph @

tools/test/BUILD

raw
1 package(default_visibility = ["//visibility:public"])
2
3 # Members of this filegroup shouldn't have duplicate basenames, otherwise
4 # TestRunnerAction#getRuntimeArtifact() will get confused.
5 # Deprecated, do not use.
6 filegroup(
7 name = "runtime",
8 srcs = ["test-setup.sh"],
9 )
10
11 filegroup(
12 name = "test_setup",
13 srcs = ["test-setup.sh"],
14 )
15
16 filegroup(
17 name = "test_xml_generator",
18 srcs = ["generate-xml.sh"],
19 )
20
21 filegroup(
22 name = "collect_coverage",
23 srcs = ["collect_coverage.sh"],
24 )
25
26 filegroup(
27 name = "coverage_support",
28 srcs = ["collect_coverage.sh"],
29 )
30
31 filegroup(
32 name = "collect_cc_coverage",
33 srcs = ["collect_cc_coverage.sh"],
34 )
35
36 # Test wrapper binary to run tests on Windows.
37 # This target just wraps the actual code in "tw_lib" to make it into a binary.
38 # See https://github.com/bazelbuild/bazel/issues/5508
39 cc_binary(
40 name = "tw",
41 srcs = ["windows/tw_main.cc"],
42 visibility = ["//visibility:private"],
43 deps = [":tw_lib"],
44 )
45
46 cc_binary(
47 name = "xml",
48 srcs = ["windows/xml_main.cc"],
49 visibility = ["//visibility:private"],
50 deps = [":tw_lib"],
51 )
52
53 # Test wrapper binary to run tests on Windows.
54 # See https://github.com/bazelbuild/bazel/issues/5508
55 cc_library(
56 name = "tw_lib",
57 srcs = select({
58 "@bazel_tools//src/conditions:windows": ["windows/tw.cc"],
59 "//conditions:default": ["empty_test_wrapper.cc"],
60 }),
61 hdrs = select({
62 "@bazel_tools//src/conditions:windows": ["windows/tw.h"],
63 "//conditions:default": [],
64 }),
65 linkopts = select({
66 "//src/conditions:windows": [
67 "-DEFAULTLIB:advapi32.lib", # GetUserNameW
68 ],
69 "//conditions:default": [],
70 }),
71 visibility = ["//visibility:private"],
72 deps = select({
73 "@bazel_tools//src/conditions:windows": [
74 "//src/main/cpp/util:filesystem",
75 "//src/main/cpp/util:strings",
76 "//src/main/native/windows:lib-file",
77 "//src/main/native/windows:lib-process",
78 "//third_party/ijar:zip",
79 "@bazel_tools//tools/cpp/runfiles",
80 ],
81 "//conditions:default": [],
82 }),
83 )
84
85 cc_test(
86 name = "tw_test",
87 srcs = select({
88 "@bazel_tools//src/conditions:windows": ["windows/tw_test.cc"],
89 "//conditions:default": ["empty_test.cc"],
90 }),
91 deps = [
92 ":tw_lib",
93 "//src/main/cpp/util:filesystem",
94 "//src/test/cpp/util:windows_test_util",
95 "@com_google_googletest//:gtest_main",
96 ] + select({
97 "@bazel_tools//src/conditions:windows": [
98 "//src/main/native/windows:lib-file",
99 "//third_party/ijar:zip",
100 ],
101 "//conditions:default": [],
102 }),
103 )
104
105 filegroup(
106 name = "srcs",
107 srcs = glob(["**"]),
108 )
109
110 filegroup(
111 name = "embedded_tools",
112 srcs = [
113 "BUILD.tools",
114 "collect_cc_coverage.sh",
115 "collect_coverage.sh",
116 "extensions.bzl",
117 "generate-xml.sh",
118 "test-setup.sh",
119 ] + select({
120 "@bazel_tools//src/conditions:windows": [
121 "tw",
122 "xml",
123 ],
124 "//conditions:default": [
125 "dummy.sh",
126 ],
127 }),
128 visibility = ["//tools:__pkg__"],
129 )
130
131 filegroup(
132 name = "bzl_srcs",
133 srcs = ["extensions.bzl"],
134 )