test(rng): add XAHAU_RNG_TEST env var filter for focused test runs

Set XAHAU_RNG_TEST=<substring> to run only matching test methods.
e.g. XAHAU_RNG_TEST=SingleByzantine runs only that test.
This commit is contained in:
Nicholas Dudfield
2026-04-09 16:51:26 +07:00
parent 8307fca3b9
commit 52671bfc99

View File

@@ -688,21 +688,35 @@ public:
void
run() override
{
testRngCommitRevealConverges();
testRngCommitRevealConvergesWithTransactions();
testRngImpossibleQuorumFallback();
testRngPersistentLossDoesNotShrinkQuorum();
testRngTimeoutWithPartialQuorum();
testRngCommitSetConflictForcesFallback();
testRngObserverDoesNotExpectSelfCommit();
testRngIgnoresNonUNLData();
testRngRejectsRevealWithoutCommit();
testRngRejectsInvalidReveal();
testRngCommitChangeClearsStaleReveal();
testRngRevealTimeoutAsymmetricDelays();
testRngEntropyConvergesWithPartialReveals();
testRngEntropyFallbackOnMajorRevealLoss();
testRngSingleByzantineCannotDenyEntropy();
// Set XAHAU_RNG_TEST=<name> to run a single test method.
// e.g. XAHAU_RNG_TEST=SingleByzantine
auto const* filter = std::getenv("XAHAU_RNG_TEST");
std::string f = filter ? filter : "";
#define RUN(method) \
do \
{ \
if (f.empty() || std::string(#method).find(f) != std::string::npos) \
method(); \
} while (false)
RUN(testRngCommitRevealConverges);
RUN(testRngCommitRevealConvergesWithTransactions);
RUN(testRngImpossibleQuorumFallback);
RUN(testRngPersistentLossDoesNotShrinkQuorum);
RUN(testRngTimeoutWithPartialQuorum);
RUN(testRngCommitSetConflictForcesFallback);
RUN(testRngObserverDoesNotExpectSelfCommit);
RUN(testRngIgnoresNonUNLData);
RUN(testRngRejectsRevealWithoutCommit);
RUN(testRngRejectsInvalidReveal);
RUN(testRngCommitChangeClearsStaleReveal);
RUN(testRngRevealTimeoutAsymmetricDelays);
RUN(testRngEntropyConvergesWithPartialReveals);
RUN(testRngEntropyFallbackOnMajorRevealLoss);
RUN(testRngSingleByzantineCannotDenyEntropy);
#undef RUN
}
};