]> granicus.if.org Git - php/commitdiff
Give back the php file and leave it in case test fails.
authorMarcus Boerger <helly@php.net>
Tue, 22 Oct 2002 08:54:23 +0000 (08:54 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 22 Oct 2002 08:54:23 +0000 (08:54 +0000)
run-tests.php

index 2304f69c0d8055137293edf003f9d68c5df1a699..25dbea7b3522ba36b23d9fe897e43c7982e2a94d 100755 (executable)
@@ -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';
                }