diff options
| author | Leitwolf | 2026-10-24 19:03:40 +0300 |
|---|---|---|
| committer | GitHub | 2026-10-24 19:03:40 +0300 |
| commit | 4f1c759cffcb14bd6511e1d7c5fbace682e24f2d (patch) | |
| tree | 415fe5d48a5b48650bba3747beaf245d727c4f61 /tests/TestScripts/DiscoverTests | |
| parent | 83c6fc3ac13abe83fa39f7b5f8559ccaf4412233 (diff) | |
| parent | 622188f9c08e4af35941c146979883ed4882410e (diff) | |
| download | catch3-4f1c759cffcb14bd6511e1d7c5fbace682e24f2d.tar.gz | |
Merge pull request #15 from Progmasoft/feature/catch3-runner
Replace Catch2's runner with the Catch3 runner
Diffstat (limited to 'tests/TestScripts/DiscoverTests')
| -rw-r--r-- | tests/TestScripts/DiscoverTests/VerifyRegistration.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/TestScripts/DiscoverTests/VerifyRegistration.py b/tests/TestScripts/DiscoverTests/VerifyRegistration.py index e213bd3d..cfa2bac6 100644 --- a/tests/TestScripts/DiscoverTests/VerifyRegistration.py +++ b/tests/TestScripts/DiscoverTests/VerifyRegistration.py @@ -78,24 +78,19 @@ def get_test_names(build_path: str) -> List[TestInfo]: config_path = "Debug" if os.name == 'nt' else "" full_path = os.path.join(build_path, config_path, 'tests') - with tempfile.TemporaryDirectory() as tmpdir: - fname = f'{tmpdir}/listing-output.json' - cmd = [full_path, - '--list-tests', - '--reporter', 'json', - '--out', fname - ] - result = subprocess.run(cmd, - capture_output = False, - check = True, - text = True) - with open(fname, mode='r', encoding='utf-8') as file: - test_listing = json.load(file) + cmd = [full_path, '--list=json'] + result = subprocess.run(cmd, + capture_output = True, + check = True, + text = True, + encoding = 'utf-8') + test_listing = json.loads(result.stdout[result.stdout.index('{'):]) - assert test_listing['version'] == 2, test_listing['version'] + assert test_listing['format'] == 'catch3-tests', test_listing['format'] + assert test_listing['version'] == 1, test_listing['version'] tests = [] - for test in test_listing['listings']['tests']: + for test in test_listing['tests']: test_name = test['name'] tags = test['tags'] tests.append(TestInfo(test_name, tags)) @@ -129,11 +124,10 @@ 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, - # third is the `--order decl` arg for faster startup. + # First part of the command is the binary, second is the filter. # If there are less, registration has failed. If there are more, # registration has changed and the script needs updating. - assert len(test_command) == 3, test_command + assert len(test_command) == 2, test_command test_name = test_command[1] labels = [] for prop in test['properties']: |