Skip to content

Commit 16efc77

Browse files
committed
count($test_files) already be checked above : if ($test_cnt)
thus we can use $sum_results instead of the preg_match
1 parent 11c946e commit 16efc77

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

run-tests.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -802,14 +802,12 @@ function save_or_mail_results()
802802
fclose($failed_tests_file);
803803
}
804804

805-
if (count($test_files) || count($test_results)) {
806-
compute_summary();
807-
if ($html_output) {
808-
fwrite($html_file, "<hr/>\n" . get_summary(false, true));
809-
}
810-
echo "=====================================================================";
811-
echo get_summary(false, false);
805+
compute_summary();
806+
if ($html_output) {
807+
fwrite($html_file, "<hr/>\n" . get_summary(false, true));
812808
}
809+
echo "=====================================================================";
810+
echo get_summary(false, false);
813811

814812
if ($html_output) {
815813
fclose($html_file);
@@ -821,7 +819,7 @@ function save_or_mail_results()
821819

822820
junit_save_xml();
823821

824-
if (getenv('REPORT_EXIT_STATUS') == 1 and preg_match('/ FAILED(?: |$)/', implode(' ', $test_results))) {
822+
if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) {
825823
exit(1);
826824
}
827825

0 commit comments

Comments
 (0)