-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathBUILD
More file actions
107 lines (95 loc) · 2.34 KB
/
Copy pathBUILD
File metadata and controls
107 lines (95 loc) · 2.34 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
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
"""Small C++ CLI application for sanity testing"""
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_shared_library", "cc_test")
cc_binary(
name = "main_cpp",
srcs = ["main.cpp"],
)
cc_binary(
name = "main_pthread_cpp",
srcs = ["main_pthread.cpp"],
)
cc_library(
name = "math_lib",
srcs = ["math_lib.cpp"],
hdrs = ["math_lib.h"],
)
cc_test(
name = "math_lib_test",
srcs = ["math_lib_test.cpp"],
linkstatic = True,
deps = [":math_lib"],
)
cc_shared_library(
name = "math_lib_shared",
shared_lib_name = "libmath_lib_shared.so",
deps = [":math_lib"],
)
cc_test(
name = "math_lib_dyn_test",
srcs = ["math_lib_test.cpp"],
dynamic_deps = [":math_lib_shared"],
linkstatic = False,
deps = [":math_lib"],
)
cc_test(
name = "asan_test",
srcs = ["asan_test.cpp"],
features = ["asan"],
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
# for some reason this test is very flaky.
# cc_test(
# name = "tsan_test",
# srcs = ["tsan_test.cpp"],
# features = ["tsan"],
# env = {
# "TSAN_OPTIONS": "halt_on_error=1",
# },
# deps = [
# "@googletest//:gtest",
# "@googletest//:gtest_main",
# ],
# )
cc_test(
name = "ubsan_test",
srcs = ["ubsan_test.cpp"],
features = ["ubsan"],
env = {
"UBSAN_OPTIONS": "halt_on_error=1",
},
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)
cc_test(
name = "lsan_test",
srcs = ["lsan_test.cpp"],
features = [
"lsan",
"asan",
],
env = {
"ASAN_OPTIONS": "detect_leaks=1",
"LSAN_OPTIONS": "exitcode=23",
},
deps = [
"@googletest//:gtest",
"@googletest//:gtest_main",
],
)