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

summaryrefslogtreecommitdiffhomepage
path: root/tests/TestScripts/testPartialTestCaseEvent.py
diff options
context:
space:
mode:
authorLeitwolf2026-10-24 19:03:40 +0300
committerGitHub2026-10-24 19:03:40 +0300
commit4f1c759cffcb14bd6511e1d7c5fbace682e24f2d (patch)
tree415fe5d48a5b48650bba3747beaf245d727c4f61 /tests/TestScripts/testPartialTestCaseEvent.py
parent83c6fc3ac13abe83fa39f7b5f8559ccaf4412233 (diff)
parent622188f9c08e4af35941c146979883ed4882410e (diff)
downloadcatch3-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-xtests/TestScripts/testPartialTestCaseEvent.py23
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:]