From 7495f83e2a6e1aa69592fcda6e5c6c1b0b4fa118 Mon Sep 17 00:00:00 2001 From: Vy Nguyen Date: Fri, 20 Oct 2023 08:51:32 -0400 Subject: Set -Wno-unused-variable for tests (#1682) We used assert() a lot in tests and that can cause build breakages in some of the opt builds (since assert() are removed) it's not practical to sprinkle "(void)" everywhere so I think setting this warning option is the best option for now. --- test/BUILD | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/BUILD') diff --git a/test/BUILD b/test/BUILD index ea34fd4..22b7dba 100644 --- a/test/BUILD +++ b/test/BUILD @@ -18,6 +18,9 @@ TEST_COPTS = [ # "-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", ] # Some of the issues with DoNotOptimize only occur when optimization is enabled -- cgit v1.2.3 From 3d85343d65832d05b4dcd6666640e0e38b981c33 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Mon, 19 Feb 2024 18:22:35 +0300 Subject: Rewrite complexity_test to use (hardcoded) manual time (#1757) * Rewrite complexity_test to use (hardcoded) manual time This test is fundamentally flaky, because it tried to read tea leafs, and is inherently misbehaving in CI environments, since there are unmitigated sources of noise. That being said, the computed Big-O also depends on the `--benchmark_min_time=` Fixes https://github.com/google/benchmark/issues/272 * Correctly compute Big-O for manual timings. Fixes #1758. * complexity_test: do more stuff in empty loop * Make all empty loops be a bit longer empty Looks like on windows, some of these tests still fail, i guess clock precision is too small. --- test/BUILD | 1 + 1 file changed, 1 insertion(+) (limited to 'test/BUILD') diff --git a/test/BUILD b/test/BUILD index 22b7dba..e43b802 100644 --- a/test/BUILD +++ b/test/BUILD @@ -35,6 +35,7 @@ PER_SRC_TEST_ARGS = { "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"], } cc_library( -- cgit v1.2.3 From c64b144f42f7e17bfebd3d2220f8daac48e6365c Mon Sep 17 00:00:00 2001 From: dominic <510002+dmah42@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:19:56 +0000 Subject: mitigate clang build warnings -Wconversion (#1763) * mitigate clang build warnings -Wconversion * ensure we have warnings set everywhere and fix some --- test/BUILD | 1 + 1 file changed, 1 insertion(+) (limited to 'test/BUILD') diff --git a/test/BUILD b/test/BUILD index e43b802..b245fa7 100644 --- a/test/BUILD +++ b/test/BUILD @@ -21,6 +21,7 @@ TEST_COPTS = [ ## 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", ] # Some of the issues with DoNotOptimize only occur when optimization is enabled -- cgit v1.2.3