-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expand file tree
/
Copy pathBUILD.bazel
More file actions
70 lines (61 loc) · 1.35 KB
/
BUILD.bazel
File metadata and controls
70 lines (61 loc) · 1.35 KB
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
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load(":tools.bzl", "test_set")
DEPS = [
"//:cjson",
"//:cjson_tests",
"//:cjson_utils",
"//tests/unity",
"//tests/unity:unity-examples",
] + select({
"@platforms//os:windows": [":unity-win"],
"//conditions:default": [],
})
DATA = [
":patch-test_inputs",
":test_inputs",
]
HDRS = glob(["*.h"])
cc_library(
name = "unity-win",
srcs = ["unity_setup.c"],
)
filegroup(
name = "test_inputs",
srcs = glob(["inputs/*"]),
visibility = ["//tests:__pkg__"],
)
filegroup(
name = "patch-test_inputs",
srcs = glob(["json-patch-tests/*.json"]),
visibility = ["//tests:__pkg__"],
)
test_suite(
name = "unity_tests",
tests = test_set(
srcs = HDRS,
data = DATA,
test_files = glob(
["*.c"],
exclude = [
"unity_setup.c",
"parse_examples.c",
"json_patch_tests.c",
],
),
deps = DEPS,
),
)
cc_test(
name = "parse_examples",
srcs = HDRS + ["parse_examples.c"],
copts = ['-DTEST_DIR_PATH=\\"tests/inputs/\\"'],
data = DATA,
deps = DEPS,
)
cc_test(
name = "json_patch_tests",
srcs = HDRS + ["json_patch_tests.c"],
copts = ['-DTEST_DIR_PATH=\\"tests/json-patch-tests/\\"'],
data = DATA,
deps = DEPS,
)