mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-29 15:37:46 +00:00
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:
@@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user