diff options
| author | Martin Hořeňovský | 2026-09-11 13:13:12 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2026-09-11 13:13:15 +0200 |
| commit | 6534dbc3ef3a162111830d9b5d8a9092d378336d (patch) | |
| tree | 8971c4412b3533c944e7f321cf2a02d0a786b8e4 /tests | |
| parent | b7f1a83ff0c36990a9840bcb3de56a848d24a893 (diff) | |
| download | catch3-6534dbc3ef3a162111830d9b5d8a9092d378336d.tar.gz | |
catch_discover_tests registers tests with --order decl
Catch2 defaults to random test execution order, which has to process
all tests present in the binary, even if they will be filtered down
to just 1 later. For the `SelfTest` binary, the overhead from this is
about 20% in Debug configuration and 5% in Release.
By registering the CTest tests with `--order decl`, we avoid this
overhead.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/TestScripts/DiscoverTests/VerifyRegistration.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/tests/TestScripts/DiscoverTests/VerifyRegistration.py index d33006dd..e213bd3d 100644 --- a/tests/TestScripts/DiscoverTests/VerifyRegistration.py +++ b/tests/TestScripts/DiscoverTests/VerifyRegistration.py @@ -92,7 +92,7 @@ def get_test_names(build_path: str) -> List[TestInfo]: with open(fname, mode='r', encoding='utf-8') as file: test_listing = json.load(file) - assert test_listing['version'] == 2 + assert test_listing['version'] == 2, test_listing['version'] tests = [] for test in test_listing['listings']['tests']: @@ -129,10 +129,11 @@ def extract_tests_from_ctest(ctest_output) -> List[TestInfo]: test_infos = [] for test in tests: test_command = test['command'] - # First part of the command is the binary, second is the filter. + # First part of the command is the binary, second is the filter, + # third is the `--order decl` arg for faster startup. # If there are less, registration has failed. If there are more, # registration has changed and the script needs updating. - assert len(test_command) == 2 + assert len(test_command) == 3, test_command test_name = test_command[1] labels = [] for prop in test['properties']: |