diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 201056a..25f9c26 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -180,8 +180,8 @@ function simpletest_run_tests($test_list) { */ function simpletest_run_phpunit_tests($test_id, array $unescaped_test_classnames, &$status = NULL) { $phpunit_file = simpletest_phpunit_xml_filepath($test_id); - $ret = simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file, $status); - if ($ret) { + simpletest_phpunit_run_command($unescaped_test_classnames, $phpunit_file, $status); + if ($status) { // Something broke during the execution of phpunit. // Return an error record of all failed classes. $rows[] = [ diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index c162f37..1994858 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -705,20 +705,22 @@ function simpletest_script_run_one_test($test_id, $test_class) { } $test = new $class_name($test_id); if (is_subclass_of($test_class, '\PHPUnit_Framework_TestCase')) { - simpletest_script_run_phpunit($test_id, $test_class); + $status = simpletest_script_run_phpunit($test_id, $test_class); } else { $test->dieOnFail = (bool) $args['die-on-fail']; $test->verbose = (bool) $args['verbose']; $test->run($methods); simpletest_script_reporter_display_summary($test_class, $test->results); - } - // Finished, kill this runner. - if ($test->results['#fail'] || $test->results['#exception']) { - exit(SIMPLETEST_SCRIPT_EXIT_FAILURE); + $status = SIMPLETEST_SCRIPT_EXIT_SUCCESS; + // Finished, kill this runner. + if ($test->results['#fail'] || $test->results['#exception']) { + $status = SIMPLETEST_SCRIPT_EXIT_FAILURE; + } } - exit(SIMPLETEST_SCRIPT_EXIT_SUCCESS); + + exit($status); } // DrupalTestCase::run() catches exceptions already, so this is only reached // when an exception is thrown in the wrapping test runner environment.