fixup! Parse test execution time in unity fixture output

This commit is contained in:
Florence Yernaux
2023-05-17 08:59:32 +02:00
parent eae109afc3
commit 42997fbf14
+6 -4
View File
@@ -143,13 +143,14 @@ class ParseOutput
def test_failed_unity_fixture(array)
class_name = array[0]
test_name = array[1]
test_time = get_test_time(array[array.length - 1])
test_suite_verify(class_name)
reason_array = array[2].split(':')
reason = reason_array[-1].lstrip.chomp + ' at line: ' + reason_array[-4]
printf "%-40s FAILED\n", test_name
printf "%-40s FAILED %10d ms\n", test_name, test_time
push_xml_output_failed(test_name, reason) if @xml_out
push_xml_output_failed(test_name, reason, test_time) if @xml_out
end
# Test was flagged as being ignored so format the output.
@@ -157,6 +158,7 @@ class ParseOutput
def test_ignored_unity_fixture(array)
class_name = array[0]
test_name = array[1]
test_time = get_test_time(array[array.length - 1])
reason = 'No reason given'
if array.size > 2
reason_array = array[2].split(':')
@@ -164,9 +166,9 @@ class ParseOutput
reason = tmp_reason == 'IGNORE' ? 'No reason given' : tmp_reason
end
test_suite_verify(class_name)
printf "%-40s IGNORED\n", test_name
printf "%-40s IGNORED %10d ms\n", test_name, test_time
push_xml_output_ignored(test_name, reason) if @xml_out
push_xml_output_ignored(test_name, reason, test_time) if @xml_out
end
# Test was flagged as having passed so format the output