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/testPartialTestCaseEvent.py | |
| 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/testPartialTestCaseEvent.py')
| -rwxr-xr-x | tests/TestScripts/testPartialTestCaseEvent.py | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/tests/TestScripts/testPartialTestCaseEvent.py b/tests/TestScripts/testPartialTestCaseEvent.py index 55c6e299..fb3932cc 100755 --- a/tests/TestScripts/testPartialTestCaseEvent.py +++ b/tests/TestScripts/testPartialTestCaseEvent.py @@ -8,9 +8,9 @@ # SPDX-License-Identifier: BSL-1.0 """ -This test script verifies that the testCasePartial{Starting,Ended} reporter +This test script verifies that the testCasePartial{Starting,Ended} listener events fire properly. This is done by calling a test binary compiled with -reporter that reports specifically testCase* events, and verifying the +a listener that records specifically testCase* events, and verifying the outputs match what we expect. """ @@ -46,21 +46,20 @@ TestCaseEnded: generator from typing import List -def get_test_output(test_exe: str, sections: bool) -> List[str]: - cmd = [test_exe, '--reporter', 'partial'] - if sections: - cmd.append('section') - else: - cmd.append('generator') - +def get_test_output(test_exe: str, sections: bool) -> str: + cmd = [test_exe, '--no-history', 'section' if sections else 'generator'] ret = subprocess.run(cmd, stdout = subprocess.PIPE, stderr = subprocess.PIPE, - timeout = 10, + timeout = 30, check = True, universal_newlines = True) - - return ret.stdout + # The listener prints the events when the run ends, outside any test; + # the runner passes that output on. + output = ret.stdout + ret.stderr + start = output.index('BEGIN EVENTS\n') + len('BEGIN EVENTS\n') + end = output.index('END EVENTS', start) + return output[start:end].replace('\r\n', '\n') def main(): test_exe, = sys.argv[1:] |