From 52bb8f78a058cadfadd70f7918af5a7ce8995524 Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Tue, 31 Jul 2007 21:29:21 +0000 Subject: [PATCH] MFH:- Allow using * in test filenames to match pattern --- run-tests.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- 2.40.0