Slightly deduplicate run-tests code

This commit is contained in:
Nikita Popov 2020-05-20 11:58:42 +02:00
parent c2068e95b4
commit ec1e8540d8

View file

@ -678,10 +678,11 @@ NO_PROC_OPEN_ERROR;
// Run selected tests.
$test_cnt = count($test_files);
if ($test_cnt) {
putenv('NO_INTERACTION=1');
verify_config();
write_information();
if ($test_cnt) {
putenv('NO_INTERACTION=1');
usort($test_files, "test_sort");
$start_time = time();
@ -721,20 +722,7 @@ NO_PROC_OPEN_ERROR;
if ($output_file != '' && $just_save_results) {
save_or_mail_results();
}
junit_save_xml();
if (getenv('REPORT_EXIT_STATUS') !== '0' &&
getenv('REPORT_EXIT_STATUS') !== 'no' && ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['LEAKED'])) {
exit(1);
}
return;
}
verify_config();
write_information();
} else {
// Compile a list of all test files (*.phpt).
$test_files = array();
$exts_tested = count($exts_to_test);
@ -799,13 +787,13 @@ NO_PROC_OPEN_ERROR;
}
save_or_mail_results();
}
junit_save_xml();
if (getenv('REPORT_EXIT_STATUS') !== '0' &&
getenv('REPORT_EXIT_STATUS') !== 'no' && ($sum_results['FAILED'] || $sum_results['LEAKED'])) {
if (getenv('REPORT_EXIT_STATUS') !== '0' && getenv('REPORT_EXIT_STATUS') !== 'no' &&
($sum_results['FAILED'] || $sum_results['LEAKED'])) {
exit(1);
}
exit(0);
}
if (!function_exists("hrtime")) {