helly           Sun Mar 28 09:12:15 2004 EDT

  Modified files:              
    /php-src    run-tests.php 
  Log:
  Show progress
  
http://cvs.php.net/diff.php/php-src/run-tests.php?r1=1.189&r2=1.190&ty=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.189 php-src/run-tests.php:1.190
--- php-src/run-tests.php:1.189 Tue Mar  9 09:39:35 2004
+++ php-src/run-tests.php       Sun Mar 28 09:12:14 2004
@@ -275,13 +275,15 @@
        }
 
        // Run selected tests.
-       if (count($test_files)) {
+       $test_cnt = count($test_files);
+       if ($test_cnt) {
                write_information();
                usort($test_files, "test_sort");
                echo "Running selected tests.\n";
                $start_time = time();
+               $test_idx = 0;
                foreach($test_files AS $name) {
-                       $test_results[$name] = run_test($php,$name);
+                       $test_results[$name] = 
run_test($php,$name,$test_cnt,++$test_idx);
                        if ($failed_tests_file && ($test_results[$name] == 'FAILED' || 
$test_results[$name] == 'WARNED')) {
                                fwrite($failed_tests_file, "$name\n");
                        }
@@ -383,8 +385,10 @@
 =====================================================================
 ";
 
+$test_cnt = count($test_files);
+$test_idx = 0;
 foreach ($test_files as $name) {
-       $test_results[$name] = run_test($php,$name);
+       $test_results[$name] = run_test($php,$name,$test_cnt,++$test_idx);
 }
 
 $end_time = time();
@@ -632,7 +636,7 @@
 //  Run an individual test case.
 //
 
-function run_test($php, $file)
+function run_test($php, $file, $test_cnt, $test_idx)
 {
        global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS;
 
@@ -675,11 +679,11 @@
                // Add to the section text.
                $section_text[$section] .= $line;
        }
-       if ([EMAIL PROTECTED]($section_text['FILE'])) {
+       if (@count($section_text['FILE']) != 1) {
                echo "BORK missing section --FILE-- [$file]\n";
                return 'BORKED';
        }
-       if (!(@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + 
@count($section_text['EXPECTREGEX']))) {
+       if ((@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + 
@count($section_text['EXPECTREGEX'])) != 1) {
                echo "BORK missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX-- 
[$file]\n";
                return 'BORKED';
        }
@@ -696,7 +700,7 @@
        $shortname = str_replace($cwd.'/', '', $file);
        $tested = trim($section_text['TEST'])." [$shortname]";
 
-       echo "TEST [$shortname]\r";
+       echo "TEST $test_idx/$test_cnt [$shortname]\r";
        flush();
 
        $tmp = realpath(dirname($file));

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

Reply via email to