mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 21:35:40 +02:00
Use console reporter's totals summary for compact reporter
This changes the compact reporter's summary of test run totals to use the same format as the console reporter. This means that while output is no longer on a single line (two instead), it now includes totals for `failedButOk` test cases and assertions, which were previously missing.
This commit is contained in:

committed by
Martin Hořeňovský

parent
8ce92d2c72
commit
6185d0cc0a
@@ -30,15 +30,12 @@ build_dir_path = os.path.join(os.path.abspath(sys.argv[2]), 'CMakeConfigTests',
|
||||
|
||||
configure_and_build(catch2_source_path,
|
||||
build_dir_path,
|
||||
[("CATCH_CONFIG_DEFAULT_REPORTER", "compact")])
|
||||
[("CATCH_CONFIG_DEFAULT_REPORTER", "xml")])
|
||||
|
||||
stdout, _ = run_and_return_output(os.path.join(build_dir_path, 'tests'), 'SelfTest', ['[approx][custom]'])
|
||||
|
||||
|
||||
# This matches the summary line made by compact reporter, console reporter's
|
||||
# summary line does not match the regex.
|
||||
summary_regex = 'Passed \d+ test case with \d+ assertions.'
|
||||
if not re.search(summary_regex, stdout):
|
||||
print("Could not find '{}' in the stdout".format(summary_regex))
|
||||
xml_tag = '</Catch2TestRun>'
|
||||
if xml_tag not in stdout:
|
||||
print("Could not find '{}' in the stdout".format(xml_tag))
|
||||
print('stdout: "{}"'.format(stdout))
|
||||
exit(2)
|
||||
|
Reference in New Issue
Block a user