Skip to content
Snippets Groups Projects
Commit cabd5e6d authored by Florian Angerer's avatar Florian Angerer
Browse files

Detect and parse RUnit test protocol.

parent 547c202e
No related branches found
No related tags found
No related merge requests found
...@@ -556,9 +556,9 @@ def handle_output_file(file, test_output_file_contents): ...@@ -556,9 +556,9 @@ def handle_output_file(file, test_output_file_contents):
if "testthat results" in test_output_file_contents[i]: if "testthat results" in test_output_file_contents[i]:
mx.log("Detected testthat summary in {!s}".format(file)) mx.log("Detected testthat summary in {!s}".format(file))
return _parse_testthat_result(test_output_file_contents, i) return _parse_testthat_result(test_output_file_contents, i)
elif "RUNIT TEST PROTOCOL" in test_output_file_contents[i]:
# TODO parse RUnit test protocol mx.log("Detected RUNIT test protocol in {!s}".format(file))
return _parse_runit_result(test_output_file_contents, i)
# if this test did not use one of the known test frameworks, take the report from the fuzzy compare # if this test did not use one of the known test frameworks, take the report from the fuzzy compare
return None, None, None return None, None, None
...@@ -579,6 +579,20 @@ def _parse_testthat_result(lines, i): ...@@ -579,6 +579,20 @@ def _parse_testthat_result(lines, i):
return (_testthat_parse_part(ok_part), _testthat_parse_part(skipped_part), _testthat_parse_part(failed_part)) return (_testthat_parse_part(ok_part), _testthat_parse_part(skipped_part), _testthat_parse_part(failed_part))
raise Exception("Could not parse testthat status line {0}".format(result_line)) raise Exception("Could not parse testthat status line {0}".format(result_line))
def _parse_runit_result(lines, i):
'''
RUNIT TEST PROTOCOL -- Thu Feb 08 10:54:42 2018
***********************************************
Number of test functions: 20
Number of errors: 0
Number of failures: 0
:param lines:
:param i:
:return:
'''
def _testthat_parse_part(part): def _testthat_parse_part(part):
''' '''
parses a part like "OK: 2" parses a part like "OK: 2"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment