Skip to content

test(ci): discover guarded dash-bls/int128 cases so they skip, not falsely-pass (fixes #895) - #918

Merged
frstrtr merged 1 commit into
masterfrom
ci-steward/gtest-discover-guarded-cases
Jul 27, 2026
Merged

test(ci): discover guarded dash-bls/int128 cases so they skip, not falsely-pass (fixes #895)#918
frstrtr merged 1 commit into
masterfrom
ci-steward/gtest-discover-guarded-cases

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 27, 2026

Copy link
Copy Markdown
Owner

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.

…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.
@frstrtr

frstrtr commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

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 test_dash_quorum_members, test_dash_coinbase_muldiv)

gtest_add_tests(... AUTO) scans source text at configure time and registers every TEST(...) it finds — whether or not the case survives compilation. Cases behind #ifdef C2POOL_DASH_BLS / int128 guards therefore get registered but never built, and ctest reports them "Not Run". gtest_discover_tests(... PRE_TEST) queries the actual binary at test time, so a guarded-out case simply does not exist and is skipped honestly.

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 — #890 is still the PR that has to make the BLS build actually happen. Both are needed, and neither substitutes for the other.

Merging on green.

@frstrtr
frstrtr merged commit c4778ef into master Jul 27, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant