helly           Sun Dec 18 14:50:06 2005 EDT

  Modified files:              
    /php-src    run-tests.php 
  Log:
  - WS
  - End test script when detecting '===DONE===' that way showing memleaks
  
  
http://cvs.php.net/viewcvs.cgi/php-src/run-tests.php?r1=1.261&r2=1.262&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.261 php-src/run-tests.php:1.262
--- php-src/run-tests.php:1.261 Sun Dec 18 12:11:54 2005
+++ php-src/run-tests.php       Sun Dec 18 14:50:06 2005
@@ -23,7 +23,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: run-tests.php,v 1.261 2005/12/18 12:11:54 helly Exp $ */
+/* $Id: run-tests.php,v 1.262 2005/12/18 14:50:06 helly Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -227,7 +227,7 @@
 $pass_option_n = false;
 $pass_options = '';
 
-$compression = 0;              
+$compression = 0;
 $output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt';
 if ($compression) {
        $output_file = 'compress.zlib://' . $output_file . '.gz';
@@ -350,7 +350,7 @@
                                        $html_output = is_resource($html_file);
                                        break;
                                case '--version':
-                                       echo "$Revision: 1.261 $\n";
+                                       echo "$Revision: 1.262 $\n";
                                        exit(1);
                                default:
                                        echo "Illegal switch specified!\n";
@@ -389,10 +389,10 @@
 
     -q          Quite, no user interaction (same as environment 
NO_INTERACTION).
 
-       --verbose
+    --verbose
     -v          Verbose mode.
 
-       --help
+    --help
     -h          This Help.
 
     --html <file> Generate HTML output.
@@ -679,9 +679,9 @@
                
                if ($just_save_results || !mail_qa_team($failed_tests_data, 
$compression, $status)) {
                        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";
@@ -898,18 +898,29 @@
                $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
@@ -1102,9 +1113,9 @@
                        }
                        $test_cnt += (count($test_files) - 1) * 
($unicode_and_native ? 2 : 1);
                        $test_idx--;
-       
+
                        show_redirect_start($IN_REDIRECT['TESTS'], $tested, 
$tested_file);
-       
+
                        // set up environment
                        foreach ($IN_REDIRECT['ENV'] as $k => $v) {
                                putenv("$k=$v");
@@ -1191,7 +1202,6 @@
                        unset($section_text['UEXPECTREGEX']);
                }
        }
-
        settings2params($ini_settings);
 
        // We've satisfied the preconditions - run the test!
@@ -1354,17 +1364,17 @@
                if (strpos($log_format,'E') !== FALSE && 
file_put_contents($exp_filename, $wanted) === FALSE) {
                        error("Cannot create expected test output - 
$exp_filename");
                }
-
+       
                // write .out
                if (strpos($log_format,'O') !== FALSE && 
file_put_contents($output_filename, $output) === FALSE) {
                        error("Cannot create test output - $output_filename");
                }
-
+       
                // write .diff
                if (strpos($log_format,'D') !== FALSE && 
file_put_contents($diff_filename, generate_diff($wanted,$wanted_re,$output)) 
=== FALSE) {
                        error("Cannot create test diff - $diff_filename");
                }
-
+       
                // write .log
                if (strpos($log_format,'L') !== FALSE && 
file_put_contents($log_filename, "
 ---- EXPECTED OUTPUT

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

Reply via email to