From 502f1996b73e6ad5a89b5d9264f864bee0584f89 Mon Sep 17 00:00:00 2001 From: frstrtr Date: Mon, 27 Jul 2026 01:59:06 +0000 Subject: [PATCH] test(ci): discover guarded dash-bls/int128 cases so compiled-out cases skip, not falsely-pass (fixes #895) The three targets converted here register TEST cases behind compile guards: test_dash_bls_verify and test_dash_quorum_members gate cases on #ifdef C2POOL_DASH_BLS; test_dash_coinbase_muldiv gates on #if defined(__SIZEOF_INT128__) / #else. gtest_add_tests(... AUTO) scans source at configure time and registers those cases unconditionally, so on a build where the guard is off the compiled-out case is invoked via --gtest_filter, matches nothing, and ctest reports success -- a false pass masking absent coverage. gtest_discover_tests enumerates the actual built binary, so a guarded-out case is simply not registered. Scope: only the targets that actually contain compile-guarded cases. Suites with runtime GTEST_SKIP (e.g. test_threading) or guards over includes only (test_coin_broadcaster) are correct under gtest_add_tests and are left unchanged. --- test/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6b42dace..460fe1f9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -567,7 +567,7 @@ if (BUILD_TESTING AND GTest_FOUND) ${Boost_LIBRARIES} ) target_link_libraries(test_dash_bls_verify PRIVATE c2pool_payout c2pool_hashrate c2pool_merged_mining) # OBJECT-lib SCC direct-naming (#22/#39) - gtest_add_tests(test_dash_bls_verify "" AUTO) + gtest_discover_tests(test_dash_bls_verify DISCOVERY_MODE PRE_TEST) # E1 Phase-L member-set selection: deterministic ComputeQuorumMembers over # the SML AS OF the WORK block (base - 8, per v23.1.7 GetAllQuorumMembers — @@ -588,7 +588,7 @@ if (BUILD_TESTING AND GTest_FOUND) ${Boost_LIBRARIES} ) target_link_libraries(test_dash_quorum_members PRIVATE c2pool_payout c2pool_hashrate c2pool_merged_mining) # OBJECT-lib SCC direct-naming (#22/#39) - gtest_add_tests(test_dash_quorum_members "" AUTO) + gtest_discover_tests(test_dash_quorum_members DISCOVERY_MODE PRE_TEST) # E1 Phase-L member-set SOURCING PLUMBING (quorum_member_source.hpp): the # #814 re-review findings — R1 send-once-per-work-block dedup + strict @@ -1125,7 +1125,7 @@ if (BUILD_TESTING AND GTest_FOUND) ${Boost_LIBRARIES} ) target_link_libraries(test_dash_coinbase_muldiv PRIVATE c2pool_payout c2pool_hashrate c2pool_merged_mining) # OBJECT-lib SCC direct-naming (#22/#39) - gtest_add_tests(test_dash_coinbase_muldiv "" AUTO) + gtest_discover_tests(test_dash_coinbase_muldiv DISCOVERY_MODE PRE_TEST) add_executable(test_dash_cb_payee test_dash_cb_payee.cpp) target_link_libraries(test_dash_cb_payee PRIVATE