Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
diff options
context:
space:
mode:
authorMatt Rasa2026-07-31 09:37:21 -0400
committerMartin Hořeňovský2026-08-11 00:08:23 +0200
commit0aeb818520028ca05cc2539ed242402ef7a7ae41 (patch)
tree90a9179143b09ae2c41b1ec62bb110f756aa09ad /tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
parent97ec4e8e2e4a86719701746d1cb2426f16292ff8 (diff)
downloadcatch3-0aeb818520028ca05cc2539ed242402ef7a7ae41.tar.gz
Emit warning when using --shard-count (> 1) with --order rand
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp')
-rw-r--r--tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
index 0717ae2e..71ddc6fd 100644
--- a/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp
@@ -473,15 +473,34 @@ TEST_CASE( "Parse rng seed in different formats", "[approvals][cli][rng-seed]" )
CAPTURE( seed_string );
auto result = cli.parse( { "tests", "--rng-seed", seed_string } );
+ REQUIRE( result );
+ Catch::Config cfg{config};
+ REQUIRE( cfg.rngSeed() == seed_value );
+ REQUIRE( cfg.rngSeedWasFixed() );
+ }
+ SECTION( "time seed is not considered fixed" ) {
+ auto result = cli.parse( { "tests", "--rng-seed", "time" } );
REQUIRE( result );
- REQUIRE( config.rngSeed == seed_value );
+
+ Catch::Config cfg{config};
+ REQUIRE_FALSE( cfg.rngSeedWasFixed() );
+ }
+ SECTION( "random-device seed is not considered fixed" ) {
+ auto result = cli.parse( { "tests", "--rng-seed", "random-device" } );
+ REQUIRE( result );
+
+ Catch::Config cfg{config};
+ REQUIRE_FALSE( cfg.rngSeedWasFixed() );
}
SECTION( "Error cases" ) {
auto seed_string =
GENERATE( "0xSEED", "999999999999", "08888", "BEEF", "123 456" );
CAPTURE( seed_string );
REQUIRE_FALSE( cli.parse( { "tests", "--rng-seed", seed_string } ) );
+
+ Catch::Config cfg{config};
+ REQUIRE_FALSE( cfg.rngSeedWasFixed() );
}
}