-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch2: fix multiple section failures #112
Conversation
fa73526
to
9ce8ba8
Compare
d03166c
to
73cdc7f
Compare
if e.returncode != 1: | ||
msg = ( | ||
"Internal Error: calling {executable} " | ||
"for test {test_id} failed (returncode={returncode}):\n" | ||
"{output}" | ||
) | ||
failure = Catch2Failure( | ||
executable, | ||
0, | ||
msg.format( | ||
executable=executable, | ||
test_id=test_id, | ||
output=e.output, | ||
returncode=e.returncode, | ||
), | ||
) | ||
|
||
return [failure], output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you get an exit code of >1 (because >1 tests fail), this would force the parser to load the first line of the executable since it's put into the test_file on line 106, which would be in binary and cause an error.
return [x.rstrip() for x in f.readlines()[index_above : index + 1]]
^^^^^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 24: invalid continuation byte
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh definitely, this seems like an oversight.
@@ -151,7 +133,7 @@ def _parse_xml( | |||
test_result = test_case.find("OverallResult") | |||
failures = [] | |||
if test_result is not None and test_result.attrib["success"] == "false": | |||
test_checks = test_case.findall("Expression") | |||
test_checks = test_case.findall(".//Expression") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get recursive test checks
for more information, see https://pre-commit.ci
Looks great, could you also add a new CHANGELOG entry? Create a new section |
Awesome, thanks! After merging this, I will make a new release. Thanks again! |
|
catch2 seems to return an exit code corresponding to the number of tests that fail when using the "SECTION" parameter