helly           Sat Nov  2 16:48:06 2002 EDT

  Modified files:              
    /php4       run-tests.php 
  Log:
  -allow parameters to be directories
  -"${dir}" -> $dir
  
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.108 php4/run-tests.php:1.109
--- php4/run-tests.php:1.108    Sat Nov  2 07:55:06 2002
+++ php4/run-tests.php  Sat Nov  2 16:48:05 2002
@@ -139,7 +139,6 @@
 
 // Determine the tests to be run.
 
-$test_to_run = array();
 $test_files = array();
 $test_results = array();
 $GLOBALS['__PHP_FAILED_TESTS__'] = array();
@@ -148,18 +147,18 @@
 if (isset($argc) && $argc > 1) {
        for ($i=1; $i<$argc; $i++) {
                $testfile = realpath($argv[$i]);
-               $test_to_run[$testfile] = 1;
+               if (is_dir($testfile)) {
+                       find_files($testfile);
+               } else if(preg_match("/\.phpt$/", $name)) {
+                       $test_files[] = $testfile;
+               }
        }
 
        // Run selected tests.
-       if (count($test_to_run)) {
+       if (count($test_files)) {
                echo "Running selected tests.\n";
-               foreach($test_to_run AS $name=>$runnable) {
-                       if(!preg_match("/\.phpt$/", $name))
-                               continue;
-                       if ($runnable) {
-                               $test_results[$name] = run_test($php,$name);
-                       }
+               foreach($test_files AS $name) {
+                       $test_results[$name] = run_test($php,$name);
                }
                if(getenv('REPORT_EXIT_STATUS') == 1 and ereg('FAILED( |$)', implode(' 
', $test_results))) {
                        exit(1);
@@ -182,7 +181,7 @@
 }
 
 foreach ($user_tests as $dir) {
-       find_files("{$dir}", ($dir == 'ext'));
+       find_files($dir, ($dir == 'ext'));
 }
 
 function find_files($dir,$is_ext_dir=FALSE,$ignore=FALSE)



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

Reply via email to