diff options
| author | Marcus Boerger <helly@php.net> | 2002-11-04 10:45:41 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2002-11-04 10:45:41 +0000 |
| commit | a71f734dec3c76675a8dd080dab88ab0e91c44b1 (patch) | |
| tree | cb687d72bb5de4e632cb7a6ac691de3835cc4c5b | |
| parent | 2b927548d3524903b03866f90892bf405db25aec (diff) | |
| download | php-git-a71f734dec3c76675a8dd080dab88ab0e91c44b1.tar.gz | |
move the run-test tests to the top
#if one of these fails there is no need for further testing
| -rwxr-xr-x | run-tests.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/run-tests.php b/run-tests.php index de6ba5edfa..24b6ef8de6 100755 --- a/run-tests.php +++ b/run-tests.php @@ -158,7 +158,7 @@ if (isset($argc) && $argc > 1) { // Run selected tests. if (count($test_files)) { - asort($test_files); + usort($test_files, "test_sort"); echo "Running selected tests.\n"; foreach($test_files AS $name) { $test_results[$name] = run_test($php,$name); @@ -220,7 +220,19 @@ function find_files($dir,$is_ext_dir=FALSE,$ignore=FALSE) closedir($o); } -sort($test_files); +function test_sort($a, $b) { + global $cwd; + + $ta = strpos($a, "{$cwd}/tests/run-test")===0 ? 1 : 0; + $tb = strpos($b, "{$cwd}/tests/run-test")===0 ? 1 : 0; + if ($ta == $tb) { + return strcmp($a, $b); + } else { + return $ta ? -1 : +1; + } +} + +usort($test_files, "test_sort"); $start_time = time(); |
