aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/cpp/util/BUILD
blob: c8b2f57caf0a57d6f7ccf118cd87b06c19a29310 (plain)
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
# 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:windows": [
            "file_posix_test.cc",
            "file_windows_test.cc",
        ],
        "//src:windows_msvc": [
            "file_windows_test.cc",
        ],
        "//conditions:default": [
            "file_posix_test.cc",
        ],
    }),
    tags = ["manual"],
    deps = [
        "//src/main/cpp/util:file",
        "//third_party:gtest",
    ] + select({
        "//src:windows": [":windows_test_util"],
        "//src:windows_msvc": [":windows_test_util"],
        "//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:windows": ["windows_test_util.cc"],
        "//src:windows_msvc": ["windows_test_util.cc"],
        "//conditions:default": [],
    }),
    deps = ["//third_party:gtest"],
)

cc_test(
    name = "windows_test_util_test",
    size = "small",
    srcs = select({
        "//src:windows": ["windows_test_util.cc"],
        "//src:windows_msvc": ["windows_test_util.cc"],
        "//conditions:default": ["dummy_test.cc"],
    }),
    deps = select({
        "//src:windows": ["//third_party:gtest"],
        "//src:windows_msvc": ["//third_party:gtest"],
        "//conditions:default": [],
    }),
)

test_suite(name = "all_tests")