diff --git a/test/cmake/raptor_require_benchmark.cmake b/test/cmake/raptor_require_benchmark.cmake index f7a09a8f..356e9ead 100644 --- a/test/cmake/raptor_require_benchmark.cmake +++ b/test/cmake/raptor_require_benchmark.cmake @@ -12,29 +12,25 @@ cmake_minimum_required (VERSION 3.18) macro (raptor_require_benchmark) enable_testing () - set (benchmark_version "1.7.1") - set (gbenchmark_git_tag "v${benchmark_version}") + set (RAPTOR_BENCHMARK_TAG "v1.8.2") - find_package (benchmark ${benchmark_version} EXACT QUIET) + find_package (benchmark QUIET) - if (NOT benchmark_FOUND) - message (STATUS "Fetching Google Benchmark ${benchmark_version}") + # Also ensure that Google Benchmark if fetched for the latest library cron, which sets the tag to "main". + if (NOT benchmark_FOUND OR "${RAPTOR_BENCHMARK_TAG}" STREQUAL "main") + message (STATUS "Fetching Google Benchmark ${RAPTOR_BENCHMARK_TAG}") include (FetchContent) FetchContent_Declare (gbenchmark_fetch_content GIT_REPOSITORY "https://github.com/google/benchmark.git" - GIT_TAG "${gbenchmark_git_tag}" + GIT_TAG "${RAPTOR_BENCHMARK_TAG}" ) option (BENCHMARK_ENABLE_TESTING "" OFF) - option (BENCHMARK_ENABLE_WERROR "" OFF) + option (BENCHMARK_ENABLE_WERROR "" OFF) # Does not apply to Debug builds. option (BENCHMARK_ENABLE_INSTALL "" OFF) - if (RAPTOR_LTO_BUILD AND NOT RAPTOR_IS_DEBUG) - option (BENCHMARK_ENABLE_LTO "" ON) - endif () - FetchContent_MakeAvailable (gbenchmark_fetch_content) else () - message (STATUS "Found Google Benchmark ${benchmark_version}") + message (STATUS " Test dependency: Google Benchmark ${benchmark_VERSION} found.") endif () # NOTE: google benchmark's CMakeLists.txt already defines Shlwapi diff --git a/test/cmake/raptor_require_test.cmake b/test/cmake/raptor_require_test.cmake index 0d53fb33..68eaaa43 100644 --- a/test/cmake/raptor_require_test.cmake +++ b/test/cmake/raptor_require_test.cmake @@ -12,24 +12,24 @@ cmake_minimum_required (VERSION 3.18) macro (raptor_require_test) enable_testing () - set (gtest_version "1.13.0") - set (gtest_git_tag "v${gtest_version}") + set (RAPTOR_GTEST_TAG "v1.13.0") - find_package (GTest ${gtest_version} EXACT QUIET) + find_package (GTest QUIET) - if (NOT GTest_FOUND) - message (STATUS "Fetching Google Test ${gtest_version}") + # Also ensure that Google Test if fetched for the latest library cron, which sets the tag to "main". + if (NOT GTest_FOUND OR "${RAPTOR_GTEST_TAG}" STREQUAL "main") + message (STATUS "Fetching Google Test ${RAPTOR_GTEST_TAG}") include (FetchContent) FetchContent_Declare (gtest_fetch_content GIT_REPOSITORY "https://github.com/google/googletest.git" - GIT_TAG "${gtest_git_tag}" + GIT_TAG "${RAPTOR_GTEST_TAG}" ) option (BUILD_GMOCK "" OFF) option (INSTALL_GTEST "" OFF) FetchContent_MakeAvailable (gtest_fetch_content) else () - message (STATUS "Found Google Test ${gtest_version}") + message (STATUS " Test dependency: Google Test ${GTest_VERSION} found.") endif () if (NOT TARGET gtest_build) diff --git a/test/performance/bin_influence_benchmark.cpp b/test/performance/bin_influence_benchmark.cpp index 81384e0f..9bcb891f 100644 --- a/test/performance/bin_influence_benchmark.cpp +++ b/test/performance/bin_influence_benchmark.cpp @@ -175,8 +175,8 @@ static void bulk_count(benchmark::State & state, double && fpr) auto view = query | hash_adaptor | std::views::common; minimiser.assign(view.begin(), view.end()); - auto & result = agent.bulk_count(minimiser); - benchmark::DoNotOptimize(result); + [[maybe_unused]] auto & result = agent.bulk_count(minimiser); + benchmark::ClobberMemory(); } } }