test(ci): discover guarded dash-bls/int128 cases so they skip, not falsely-pass (fixes #895) - #918
Conversation
…s 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.
|
Reviewed — this is the right fix for the right reason, and it is the most valuable of the three. -gtest_add_tests(test_dash_bls_verify "" AUTO)
+gtest_discover_tests(test_dash_bls_verify DISCOVERY_MODE PRE_TEST)(and the same for
That is the exact mechanism behind #895 and #769 — and it is not academic. PR #821 (the T1c byte-parity corpus, 29 shares captured off a live p2pool-dash node and cross-validated across 4 peers) is red for this and nothing else. PR #912 was red for the same reason this morning. It is also the same shape as the dead-probe class in #875/#880/#905: code that is registered, reported, and never executed. The distinction that matters: this converts a false-pass into an honest skip. It does not make guarded tests run — Merging on green. |
Narrowed per review: only the three targets that actually register compile-guarded TEST cases — test_dash_bls_verify and test_dash_quorum_members (#ifdef C2POOL_DASH_BLS) and test_dash_coinbase_muldiv (#if defined(SIZEOF_INT128)/#else).
gtest_add_tests(... AUTO) source-scans at configure time and registers guarded-out cases unconditionally; on a build with the guard off, ctest invokes a --gtest_filter that matches nothing and reports success — a false pass masking absent coverage. gtest_discover_tests enumerates the built binary, so a compiled-out case is simply not registered.
Suites with runtime GTEST_SKIP (test_threading) or guards over includes only (test_coin_broadcaster) are correct as-is and left unchanged. The earlier blanket 96-target version is preserved on ci-steward/gtest-discover-blanket-superseded.