helly           Tue Oct 22 04:54:24 2002 EDT

  Modified files:              
    /php4       run-tests.php 
  Log:
  Give back the php file and leave it in case test fails.
  
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.79 php4/run-tests.php:1.80
--- php4/run-tests.php:1.79     Mon Oct 21 06:23:31 2002
+++ php4/run-tests.php  Tue Oct 22 04:54:23 2002
@@ -404,15 +404,20 @@
 
        $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 @@
        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 @@
        $out = `$cmd`;
 
        @unlink($tmp_post);
-       @unlink($tmp_file);
 
        // Does the output match what is expected?
        $output = trim($out);
@@ -553,6 +551,7 @@
        // compare and leave on success
                $ok = (0 == strcmp($output,$wanted));
                if ($ok) {
+                       @unlink($tmp_file);
                        echo "PASS $tested\n";
                        return 'PASSED';
                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to