From: Marcus Boerger Date: Tue, 22 Oct 2002 08:54:23 +0000 (+0000) Subject: Give back the php file and leave it in case test fails. X-Git-Tag: php-4.3.0pre2~205 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8312f1443ca6a276fe0954dee7b43ee7e09489b7;p=php Give back the php file and leave it in case test fails. --- diff --git a/run-tests.php b/run-tests.php index 2304f69c0d..25dbea7b35 100755 --- a/run-tests.php +++ b/run-tests.php @@ -404,15 +404,20 @@ TEST $file $tmp = realpath(dirname($file)); $tmp_skipif = $tmp . uniqid('/phpt.'); - $tmp_file = $tmp . uniqid('/phpt.'); + $tmp_file = ereg_replace('\.phpt$','.php',$file); $tmp_post = $tmp . uniqid('/phpt.'); @unlink($tmp_skipif); @unlink($tmp_file); @unlink($tmp_post); - // Reset environment from any previous test. + // unlink old test results + @unlink(ereg_replace('\.phpt$','.diff',$file)); + @unlink(ereg_replace('\.phpt$','.log',$file)); + @unlink(ereg_replace('\.phpt$','.exp',$file)); + @unlink(ereg_replace('\.phpt$','.out',$file)); + // Reset environment from any previous test. putenv("REDIRECT_STATUS="); putenv("QUERY_STRING="); putenv("PATH_TRANSLATED="); @@ -421,12 +426,6 @@ TEST $file putenv("CONTENT_TYPE="); putenv("CONTENT_LENGTH="); - // unlink old test results - @unlink(ereg_replace('\.phpt$','.diff',$file)); - @unlink(ereg_replace('\.phpt$','.log',$file)); - @unlink(ereg_replace('\.phpt$','.exp',$file)); - @unlink(ereg_replace('\.phpt$','.out',$file)); - // Check if test should be skipped. if (array_key_exists('SKIPIF', $section_text)) { if (trim($section_text['SKIPIF'])) { @@ -521,7 +520,6 @@ COMMAND $cmd $out = `$cmd`; @unlink($tmp_post); - @unlink($tmp_file); // Does the output match what is expected? $output = trim($out); @@ -553,6 +551,7 @@ COMMAND $cmd // compare and leave on success $ok = (0 == strcmp($output,$wanted)); if ($ok) { + @unlink($tmp_file); echo "PASS $tested\n"; return 'PASSED'; }