diff options
| author | Matt Rasa | 2026-07-31 09:37:21 -0400 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-08-11 00:08:23 +0200 |
| commit | 0aeb818520028ca05cc2539ed242402ef7a7ae41 (patch) | |
| tree | 90a9179143b09ae2c41b1ec62bb110f756aa09ad /tests/SelfTest/IntrospectiveTests/CmdLine.tests.cpp | |
| parent | 97ec4e8e2e4a86719701746d1cb2426f16292ff8 (diff) | |
| download | catch3-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.cpp | 21 |
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() ); } } |