-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathBUILD.bazel
More file actions
113 lines (104 loc) · 2.81 KB
/
BUILD.bazel
File metadata and controls
113 lines (104 loc) · 2.81 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
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
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//osrf_testing_tools_cpp/bazel:defs.bzl", "test_runner_sh_test")
cc_library(
name = "backward-cpp",
srcs = [
"osrf_testing_tools_cpp/src/memory_tools/vendor/bombela/backward-cpp/backward.cpp",
"osrf_testing_tools_cpp/src/memory_tools/vendor/bombela/backward-cpp/backward.hpp"
],
includes = ["osrf_testing_tools_cpp/src"]
)
cc_library(
name = "memory_tools",
srcs = glob(include = [
"osrf_testing_tools_cpp/src/memory_tools/*.cpp",
"osrf_testing_tools_cpp/src/memory_tools/*.hpp"
],
exclude = [
"osrf_testing_tools_cpp/src/memory_tools/memory_tools.cpp"
]),
textual_hdrs = selects.with_or(
{
("@platforms//os:linux"): [
"osrf_testing_tools_cpp/src/memory_tools/impl/linux.cpp",
"osrf_testing_tools_cpp/src/memory_tools/impl/static_allocator.hpp",
"osrf_testing_tools_cpp/src/memory_tools/impl/unix_common.cpp",
"osrf_testing_tools_cpp/src/memory_tools/impl/unix_common.hpp",
],
}
),
hdrs = glob([
"osrf_testing_tools_cpp/include/**/*.hpp"
]),
linkopts = ["-ldl"],
includes = ["osrf_testing_tools_cpp/include"],
deps = [":backward-cpp"],
visibility = ["//visibility:public"]
)
cc_library(
name = "test_runner_headers",
hdrs = [
"osrf_testing_tools_cpp/src/test_runner/execute_process.hpp",
"osrf_testing_tools_cpp/src/test_runner/get_environment_variable.hpp",
"osrf_testing_tools_cpp/src/test_runner/parse_environment_variable.hpp",
"osrf_testing_tools_cpp/src/test_runner/starts_with.hpp",
],
includes = [
"osrf_testing_tools_cpp/src",
],
)
cc_binary(
name = "test_runner",
srcs = [
"osrf_testing_tools_cpp/src/test_runner/main.cpp",
],
deps = [
":test_runner_headers",
]
)
cc_test(
name = "test_parse_environment",
srcs = [
"osrf_testing_tools_cpp/test/test_runner/test_parse_environment_variable.cpp",
],
deps = [
":test_runner_headers",
"@googletest//:gtest_main"
]
)
cc_binary(
name = "assert_env_vars_main",
srcs = [
"osrf_testing_tools_cpp/test/test_runner/assert_env_vars.cpp",
],
deps = [
":test_runner_headers",
"@googletest//:gtest_main"
]
)
test_runner_sh_test(
name = "assert_env_vars",
test_runner = ":test_runner",
test_binary = ":assert_env_vars_main",
test_runner_args = [
"--env", "FOO=bar", "PING=pong",
"--append-env", "FOO=baz"
],
test_args = [
"--env", "FOO=bar:baz", "PING=pong"
]
)
cc_library(
name = "memory_tools_interpose",
srcs = ["osrf_testing_tools_cpp/src/memory_tools/memory_tools.cpp"],
deps = [":memory_tools"]
)
cc_test(
name = "test_memory_tools_main",
srcs = ["osrf_testing_tools_cpp/test/memory_tools/test_memory_tools.cpp"],
malloc = ":memory_tools_interpose",
deps = [
":memory_tools",
"@googletest//:gtest"
],
)