1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# Description:
# C++ utility tests for Bazel
package(default_visibility = ["//visibility:public"])
filegroup(
name = "srcs",
srcs = glob(["**"]),
visibility = ["//src/test/cpp:__pkg__"],
)
cc_test(
name = "md5_test",
srcs = ["md5_test.cc"],
deps = [
"//src/main/cpp/util",
"//src/main/cpp/util:md5",
"//third_party:gtest",
],
)
cc_test(
name = "file_test",
size = "small",
srcs = ["file_test.cc"] + select({
"//src/conditions:windows": [
"file_windows_test.cc",
],
"//conditions:default": [
"file_posix_test.cc",
],
}),
deps = [
":test_util",
"//src/main/cpp/util:file",
"//third_party:gtest",
] + select({
"//src/conditions:windows": [
":windows_test_util",
"//src/main/native/windows:lib-file",
],
"//conditions:default": [],
}),
)
cc_test(
name = "logging_test",
srcs = ["logging_test.cc"],
deps = [
"//src/main/cpp:blaze_util",
"//src/main/cpp/util:bazel_log_handler",
"//src/main/cpp/util:logging",
"//third_party:gtest",
],
)
cc_test(
name = "numbers_test",
srcs = ["numbers_test.cc"],
deps = [
"//src/main/cpp/util",
"//third_party:gtest",
],
)
cc_test(
name = "strings_test",
srcs = ["strings_test.cc"],
shard_count = 2,
deps = [
"//src/main/cpp/util:strings",
"//third_party:gtest",
],
)
cc_library(
name = "windows_test_util",
testonly = 1,
srcs = select({
"//src/conditions:windows": ["windows_test_util.cc"],
"//conditions:default": [],
}),
hdrs = select({
"//src/conditions:windows": ["windows_test_util.h"],
"//conditions:default": [],
}),
visibility = [
"//src/test/cpp:__subpackages__",
"//src/test/native:__subpackages__",
],
)
cc_test(
name = "windows_test_util_test",
size = "small",
srcs = select({
"//src/conditions:windows": ["windows_test_util_test.cc"],
"//conditions:default": ["dummy_test.cc"],
}),
deps = select({
"//src/conditions:windows": [
":windows_test_util",
"//third_party:gtest",
],
"//conditions:default": [],
}),
)
cc_library(
name = "test_util",
testonly = 1,
hdrs = ["test_util.h"],
visibility = ["//visibility:private"],
)
test_suite(name = "all_tests")
test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)
test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/cpp:__pkg__"],
)
|