From 20621c288bc8859edadd0aa05399e18e776c21a5 Mon Sep 17 00:00:00 2001 From: xjm Date: Thu, 12 Nov 2015 16:00:50 -0600 Subject: [PATCH] Issue #2580293 by alexpott, claudiu.cristea, Mixologic, catch, Fabianx: Patch having test with "PHP Fatal error" is marked as PASSED --- core/scripts/run-tests.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 9ca309f487f..eeb447673b1 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -12,6 +12,7 @@ use Drupal\Core\Database\Database; use Drupal\Core\StreamWrapper\PublicStream; use Drupal\Core\Test\TestRunnerKernel; use Drupal\simpletest\Form\SimpletestResultsForm; +use Drupal\simpletest\TestBase; use Symfony\Component\HttpFoundation\Request; $autoloader = require_once __DIR__ . '/../../autoload.php'; @@ -561,7 +562,12 @@ function simpletest_script_execute_batch($test_classes) { // The child exited, unregister it. proc_close($child['process']); if ($status['exitcode']) { - echo 'FATAL ' . $child['class'] . ': test runner returned a non-zero error code (' . $status['exitcode'] . ').' . "\n"; + $message = 'FATAL ' . $child['class'] . ': test runner returned a non-zero error code (' . $status['exitcode'] . ').'; + echo $message . "\n"; + // Insert a fail for xml results. + TestBase::insertAssert($child['test_id'], $child['class'], FALSE, $message, 'run-tests.sh check'); + /// Ensure that an error line is displayed for the class. + simpletest_script_reporter_display_summary($child['class'], ['#pass' => 0, '#fail' => 1, '#exception' => 0, '#debug' => 0]); if ($args['die-on-fail']) { list($db_prefix, ) = simpletest_last_test_get($child['test_id']); $test_directory = 'sites/simpletest/' . substr($db_prefix, 10);