cb66c5d68e
build-and-test / ubuntu-24.04-arm.Debug.static.clang++ (push) Waiting to run
build-and-test / macos-latest.Debug.shared.g++ (push) Waiting to run
build-and-test / macos-latest.Debug.static.g++ (push) Waiting to run
build-and-test / ubuntu-22.04.Debug.static.g++ (push) Waiting to run
build-and-test / ubuntu-24.04.Debug.static.g++ (push) Waiting to run
bazel / bazel.macos-latest (push) Waiting to run
bazel / bazel.windows-latest (push) Waiting to run
build-and-test-min-cmake / macos-latest.min-cmake (push) Waiting to run
build-and-test / macos-latest.Debug.shared.clang++ (push) Waiting to run
build-and-test / ubuntu-22.04.Debug.shared.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04.Debug.shared.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Debug.shared.clang++ (push) Waiting to run
build-and-test / macos-latest.Debug.static.clang++ (push) Waiting to run
build-and-test / ubuntu-22.04.Debug.static.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04.Debug.static.clang++ (push) Waiting to run
build-and-test / ubuntu-22.04.Debug.shared.g++ (push) Waiting to run
build-and-test / ubuntu-24.04.Debug.shared.g++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Debug.shared.g++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Debug.static.g++ (push) Waiting to run
build-and-test / macos-latest.Release.shared.clang++ (push) Waiting to run
build-and-test / ubuntu-22.04.Release.shared.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04.Release.shared.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Release.shared.clang++ (push) Waiting to run
build-and-test / macos-latest.Release.static.clang++ (push) Waiting to run
build-and-test / ubuntu-22.04.Release.static.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04.Release.static.clang++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Release.static.clang++ (push) Waiting to run
build-and-test / macos-latest.Release.shared.g++ (push) Waiting to run
build-and-test / ubuntu-22.04.Release.shared.g++ (push) Waiting to run
build-and-test / ubuntu-24.04.Release.shared.g++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Release.shared.g++ (push) Waiting to run
build-and-test / macos-latest.Release.static.g++ (push) Waiting to run
build-and-test / ubuntu-22.04.Release.static.g++ (push) Waiting to run
build-and-test / ubuntu-24.04.Release.static.g++ (push) Waiting to run
build-and-test / ubuntu-24.04-arm.Release.static.g++ (push) Waiting to run
build-and-test / windows-2022.Debug.shared.VS-17-2022 (push) Waiting to run
build-and-test / windows-2022.Debug.static.VS-17-2022 (push) Waiting to run
build-and-test / windows-2025.Debug.shared.VS-18-2025 (push) Waiting to run
build-and-test / windows-2025.Debug.static.VS-18-2025 (push) Waiting to run
build-and-test / windows-2022.Release.shared.VS-17-2022 (push) Waiting to run
build-and-test / windows-2022.Release.static.VS-17-2022 (push) Waiting to run
build-and-test / windows-2025.Release.shared.VS-18-2025 (push) Waiting to run
build-and-test / windows-2025.Release.static.VS-18-2025 (push) Waiting to run
build-and-test / windows-latest.Debug.shared.CLANG64 (push) Waiting to run
build-and-test / windows-latest.Debug.shared.MINGW64 (push) Waiting to run
build-and-test / windows-latest.Debug.shared.UCRT64 (push) Waiting to run
build-and-test / windows-latest.Debug.static.CLANG64 (push) Waiting to run
build-and-test / windows-latest.Debug.static.MINGW64 (push) Waiting to run
build-and-test / windows-latest.Debug.static.UCRT64 (push) Waiting to run
build-and-test / windows-latest.Release.shared.CLANG64 (push) Waiting to run
build-and-test / windows-latest.Release.shared.MINGW64 (push) Waiting to run
build-and-test / windows-latest.Release.shared.UCRT64 (push) Waiting to run
build-and-test / windows-latest.Release.static.CLANG64 (push) Waiting to run
build-and-test / windows-latest.Release.static.MINGW64 (push) Waiting to run
build-and-test / windows-latest.Release.static.UCRT64 (push) Waiting to run
test-bindings / Test Python 3.10 bindings on macos-latest (push) Waiting to run
test-bindings / Test Python 3.11 bindings on macos-latest (push) Waiting to run
test-bindings / Test Python 3.12 bindings on macos-latest (push) Waiting to run
test-bindings / Test Python 3.13 bindings on macos-latest (push) Waiting to run
test-bindings / Test Python 3.10 bindings on windows-latest (push) Waiting to run
test-bindings / Test Python 3.11 bindings on windows-latest (push) Waiting to run
test-bindings / Test Python 3.12 bindings on windows-latest (push) Waiting to run
test-bindings / Test Python 3.13 bindings on windows-latest (push) Waiting to run
test-bindings / Test Rust bindings on macos-latest (push) Waiting to run
test-bindings / Test Rust bindings on windows-latest (push) Waiting to run
bazel / bazel.ubuntu-latest (push) Failing after 1s
build-and-test-perfcounters / ubuntu-latest.Debug (push) Failing after 0s
build-and-test-perfcounters / ubuntu-latest.Release (push) Failing after 1s
doxygen / Build HTML documentation (push) Failing after 1s
python + Bazel pre-commit checks / pre-commit (push) Failing after 1s
sanitizer / tsan.Debug (push) Failing after 1s
sanitizer / ubsan.Debug (push) Failing after 0s
sanitizer / ubsan.RelWithDebInfo (push) Failing after 1s
build-and-test-min-cmake / ubuntu-latest.min-cmake (push) Failing after 1s
clang-format-lint / check-clang-format (push) Failing after 1s
sanitizer / asan.Debug (push) Failing after 1s
sanitizer / msan.RelWithDebInfo (push) Failing after 1s
clang-tidy / run-clang-tidy (push) Failing after 1s
sanitizer / msan.Debug (push) Failing after 1s
sanitizer / asan.RelWithDebInfo (push) Failing after 0s
sanitizer / tsan.RelWithDebInfo (push) Failing after 0s
test-bindings / Test Rust bindings on ubuntu-latest (push) Failing after 0s
test-bindings / Test Python 3.10 bindings on ubuntu-latest (push) Failing after 0s
test-bindings / Test Python 3.11 bindings on ubuntu-latest (push) Failing after 0s
test-bindings / Test Python 3.12 bindings on ubuntu-latest (push) Failing after 1s
test-bindings / Test Python 3.13 bindings on ubuntu-latest (push) Failing after 0s
141 lines
3.5 KiB
Python
141 lines
3.5 KiB
Python
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
|
|
|
platform(
|
|
name = "windows",
|
|
constraint_values = [
|
|
"@platforms//os:windows",
|
|
],
|
|
)
|
|
|
|
TEST_COPTS = [
|
|
"-pedantic",
|
|
"-pedantic-errors",
|
|
"-std=c++17",
|
|
"-Wall",
|
|
"-Wconversion",
|
|
"-Wextra",
|
|
"-Wshadow",
|
|
# "-Wshorten-64-to-32",
|
|
"-Wfloat-equal",
|
|
"-fstrict-aliasing",
|
|
## assert() are used a lot in tests upstream, which may be optimised out leading to
|
|
## unused-variable warning.
|
|
"-Wno-unused-variable",
|
|
"-Werror=old-style-cast",
|
|
]
|
|
|
|
TEST_MSVC_OPTS = [
|
|
"/std:c++17",
|
|
]
|
|
|
|
# Some of the issues with DoNotOptimize only occur when optimization is enabled
|
|
PER_SRC_COPTS = {
|
|
"donotoptimize_test.cc": ["-O3"],
|
|
}
|
|
|
|
TEST_ARGS = ["--benchmark_min_time=0.01s"]
|
|
|
|
PER_SRC_TEST_ARGS = {
|
|
"user_counters_tabular_test.cc": [
|
|
"--benchmark_counters_tabular=true",
|
|
"--benchmark_min_time=0.2s",
|
|
],
|
|
"repetitions_test.cc": [" --benchmark_repetitions=3"],
|
|
"spec_arg_test.cc": ["--benchmark_filter=BM_NotChosen"],
|
|
"spec_arg_verbosity_test.cc": ["--v=42"],
|
|
"complexity_test.cc": ["--benchmark_min_time=1000000x"],
|
|
"user_counters_test.cc": ["--benchmark_min_time=0.2s"],
|
|
"user_counters_threads_test.cc": ["--benchmark_min_time=0.2s"],
|
|
}
|
|
|
|
cc_library(
|
|
name = "output_test_helper",
|
|
testonly = 1,
|
|
srcs = ["output_test_helper.cc"],
|
|
hdrs = ["output_test.h"],
|
|
copts = select({
|
|
"//:windows": TEST_MSVC_OPTS,
|
|
"//conditions:default": TEST_COPTS,
|
|
}),
|
|
deps = [
|
|
"//:benchmark",
|
|
"//:benchmark_internal_headers",
|
|
],
|
|
)
|
|
|
|
# Tests that use gtest. These rely on `gtest_main`.
|
|
[
|
|
cc_test(
|
|
name = test_src[:-len(".cc")],
|
|
size = "small",
|
|
srcs = [test_src],
|
|
copts = select({
|
|
"//:windows": TEST_MSVC_OPTS,
|
|
"//conditions:default": TEST_COPTS,
|
|
}) + PER_SRC_COPTS.get(test_src, []),
|
|
deps = [
|
|
"//:benchmark",
|
|
"//:benchmark_internal_headers",
|
|
"@com_google_googletest//:gtest",
|
|
"@com_google_googletest//:gtest_main",
|
|
],
|
|
)
|
|
for test_src in glob(["*_gtest.cc"])
|
|
]
|
|
|
|
# Tests that do not use gtest. These have their own `main` defined.
|
|
[
|
|
cc_test(
|
|
name = test_src[:-len(".cc")],
|
|
size = "small",
|
|
srcs = [test_src],
|
|
args = TEST_ARGS + PER_SRC_TEST_ARGS.get(test_src, []),
|
|
copts = select({
|
|
"//:windows": TEST_MSVC_OPTS,
|
|
"//conditions:default": TEST_COPTS,
|
|
}) + PER_SRC_COPTS.get(test_src, []),
|
|
deps = [
|
|
":output_test_helper",
|
|
"//:benchmark",
|
|
"//:benchmark_internal_headers",
|
|
],
|
|
# FIXME: Add support for assembly tests to bazel.
|
|
# See Issue #556
|
|
# https://github.com/google/benchmark/issues/556
|
|
)
|
|
for test_src in glob(
|
|
["*_test.cc"],
|
|
exclude = [
|
|
"*_assembly_test.cc",
|
|
"cxx11_test.cc",
|
|
"link_main_test.cc",
|
|
],
|
|
)
|
|
]
|
|
|
|
cc_test(
|
|
name = "cxx11_test",
|
|
size = "small",
|
|
srcs = ["cxx11_test.cc"],
|
|
copts = TEST_COPTS + ["-std=c++11"],
|
|
target_compatible_with = select({
|
|
"//:windows": ["@platforms//:incompatible"],
|
|
"//conditions:default": [],
|
|
}),
|
|
deps = [
|
|
":output_test_helper",
|
|
"//:benchmark_main",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "link_main_test",
|
|
size = "small",
|
|
srcs = ["link_main_test.cc"],
|
|
copts = select({
|
|
"//:windows": TEST_MSVC_OPTS,
|
|
"//conditions:default": TEST_COPTS,
|
|
}),
|
|
deps = ["//:benchmark_main"],
|
|
)
|