Skip to content

Commit

Permalink
count($test_files) already be checked above : if ($test_cnt)
Browse files Browse the repository at this point in the history
thus we can use $sum_results instead of the preg_match
  • Loading branch information
laruence committed Nov 25, 2012
1 parent 11c946e commit 16efc77
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -802,14 +802,12 @@ function save_or_mail_results()
fclose($failed_tests_file);
}

if (count($test_files) || count($test_results)) {
compute_summary();
if ($html_output) {
fwrite($html_file, "<hr/>\n" . get_summary(false, true));
}
echo "=====================================================================";
echo get_summary(false, false);
compute_summary();
if ($html_output) {
fwrite($html_file, "<hr/>\n" . get_summary(false, true));
}
echo "=====================================================================";
echo get_summary(false, false);

if ($html_output) {
fclose($html_file);
Expand All @@ -821,7 +819,7 @@ function save_or_mail_results()

junit_save_xml();

if (getenv('REPORT_EXIT_STATUS') == 1 and preg_match('/ FAILED(?: |$)/', implode(' ', $test_results))) {
if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) {
exit(1);
}

Expand Down

0 comments on commit 16efc77

Please sign in to comment.