]> granicus.if.org Git - php/commitdiff
Fix 2 bugs:
authorWez Furlong <wez@php.net>
Thu, 7 Jul 2005 12:58:47 +0000 (12:58 +0000)
committerWez Furlong <wez@php.net>
Thu, 7 Jul 2005 12:58:47 +0000 (12:58 +0000)
- summary is only displayed if 2 or more tests were detected
- error out of a bogus test name is passed in

run-tests.php

index 99722bc9ac4c71ed893c72b693cf7e7f2a7b2b19..806828a1eb4b861e335233681cd46d2e48ab8c10 100755 (executable)
@@ -305,6 +305,8 @@ HELP;
                                find_files($testfile);
                        } else if (preg_match("/\.phpt$/", $testfile)) {
                                $test_files[] = $testfile;
+                       } else {
+                               die("bogus test name " . $argv[$i] . "\n");
                        }
                }
        }
@@ -331,7 +333,7 @@ HELP;
                        fclose($failed_tests_file);
                }
                $end_time = time();
-               if (count($test_files) > 1) {
+               if (count($test_files)) {
                        echo "
 =====================================================================";
                        compute_summary();
@@ -1236,7 +1238,6 @@ function compute_summary()
 
        $n_total = count($test_results);
        $n_total += $ignored_by_ext;
-       
        $sum_results = array('PASSED'=>0, 'WARNED'=>0, 'SKIPPED'=>0, 'FAILED'=>0, 'BORKED'=>0);
        foreach ($test_results as $v) {
                $sum_results[$v]++;