From: Jani Taskinen Date: Tue, 31 Jul 2007 21:29:21 +0000 (+0000) Subject: MFH:- Allow using * in test filenames to match pattern X-Git-Tag: php-5.2.4RC1~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52bb8f78a058cadfadd70f7918af5a7ce8995524;p=php MFH:- Allow using * in test filenames to match pattern --- diff --git a/run-tests.php b/run-tests.php index b4fcdf740a..f360af267c 100755 --- a/run-tests.php +++ b/run-tests.php @@ -474,7 +474,18 @@ HELP; } if (!$is_switch) { $testfile = realpath($argv[$i]); - if (is_dir($testfile)) { + if (!$testfile && strpos($argv[$i], '*') !== false && function_exists('glob')) { + if (preg_match("/\.phpt$/", $argv[$i])) { + $pattern_match = glob($argv[$i]); + } else if (preg_match("/\*$/", $argv[$i])) { + $pattern_match = glob($argv[$i] . '.phpt'); + } else { + die("bogus test name " . $argv[$i] . "\n"); + } + if (is_array($pattern_match)) { + $test_files = array_merge($test_files, $pattern_match); + } + } else if (is_dir($testfile)) { find_files($testfile); } else if (preg_match("/\.phpt$/", $testfile)) { $test_files[] = $testfile;