From: Marcus Boerger Date: Sun, 18 Dec 2005 14:50:33 +0000 (+0000) Subject: - MFH End test script when detecting '===DONE===' that way showing memleaks X-Git-Tag: php-5.1.2RC1~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b413f7af263ecb911e0c12e75baf66e141a8399;p=php - MFH End test script when detecting '===DONE===' that way showing memleaks --- diff --git a/run-tests.php b/run-tests.php index 4c9bf0d1a7..6408500bae 100755 --- a/run-tests.php +++ b/run-tests.php @@ -412,7 +412,7 @@ HELP; usort($test_files, "test_sort"); $start_time = time(); if (!$html_output) { - echo "Running selected tests.\n"; + echo "Running selected tests.\n"; } else { show_start($start_time); } @@ -518,7 +518,7 @@ function test_name($name) function test_sort($a, $b) { global $cwd; - + $a = test_name($a); $b = test_name($b); @@ -663,7 +663,7 @@ if ($just_save_results || !getenv('NO_INTERACTION')) { file_put_contents($output_file, $failed_tests_data); if (!$just_save_results) { - echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n"; + echo "\nThe test script was unable to automatically send the report to PHP's QA Team\n"; } echo "Please send ".$output_file." to ".PHP_QA_EMAIL." manually, thank you.\n"; @@ -867,18 +867,29 @@ TEST $file $borked = true; } $section = 'TEST'; + $secfile = false; + $secdone = false; while (!feof($fp)) { $line = fgets($fp); // Match the beginning of a section. - if (preg_match('/^--([A-Z]+)--/',$line,$r)) { + if (preg_match('/^--([A-Z]+)--/', $line, $r)) { $section = $r[1]; $section_text[$section] = ''; + $secfile = $section == 'FILE' || $section == 'FILEEOF'; + $secdone = false; continue; } // Add to the section text. - $section_text[$section] .= $line; + if (!$secdone) { + $section_text[$section] .= $line; + } + + // End of actual test? + if ($secfile && preg_match('/^===DONE===/', $line, $r)) { + $secdone = true; + } } // the redirect section allows a set of tests to be reused outside of