mirror of
https://github.com/google/benchmark.git
synced 2024-12-01 07:16:07 +00:00
df60aeb266
Having the copts set on a per-target level can lead to ODR violations in some cases. Avoid this by ensuring the regex engine is picked through compiler intrinsics in the header directly.
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
NEEDS_GTEST_MAIN = [
|
|
"statistics_test.cc",
|
|
]
|
|
|
|
TEST_COPTS = [
|
|
"-pedantic",
|
|
"-pedantic-errors",
|
|
"-std=c++11",
|
|
]
|
|
|
|
TEST_ARGS = ["--benchmark_min_time=0.01"]
|
|
|
|
cc_library(
|
|
name = "output_test_helper",
|
|
testonly = 1,
|
|
srcs = ["output_test_helper.cc"],
|
|
hdrs = ["output_test.h"],
|
|
copts = TEST_COPTS,
|
|
deps = [
|
|
"//:benchmark",
|
|
"//:benchmark_internal_headers",
|
|
],
|
|
)
|
|
|
|
[cc_test(
|
|
name = test_src[:-len(".cc")],
|
|
size = "small",
|
|
srcs = [test_src],
|
|
args = TEST_ARGS + ({
|
|
"user_counters_tabular_test.cc": ["--benchmark_counters_tabular=true"],
|
|
}).get(test_src, []),
|
|
copts = TEST_COPTS + ({
|
|
"cxx03_test.cc": ["-std=c++03"],
|
|
# Some of the issues with DoNotOptimize only occur when optimization is enabled
|
|
"donotoptimize_test.cc": ["-O3"],
|
|
}).get(test_src, []),
|
|
deps = [
|
|
":output_test_helper",
|
|
"//:benchmark",
|
|
"//:benchmark_internal_headers",
|
|
"@com_google_googletest//:gtest",
|
|
] + (
|
|
["@com_google_googletest//:gtest_main"] if (test_src in NEEDS_GTEST_MAIN) else []
|
|
),
|
|
) for test_src in glob(["*_test.cc"])]
|