jani Tue Jul 31 21:29:21 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src run-tests.php
Log:
MFH:- Allow using * in test filenames to match pattern
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.33&r2=1.226.2.37.2.34&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.33
php-src/run-tests.php:1.226.2.37.2.34
--- php-src/run-tests.php:1.226.2.37.2.33 Thu Jul 26 22:45:59 2007
+++ php-src/run-tests.php Tue Jul 31 21:29:21 2007
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: run-tests.php,v 1.226.2.37.2.33 2007/07/26 22:45:59 jani Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.34 2007/07/31 21:29:21 jani Exp $ */
/* Sanity check to ensure that pcre extension needed by this script is
available.
* In the event it is not, print a nice error message indicating that this
script will
@@ -399,7 +399,7 @@
$html_output = is_resource($html_file);
break;
case '--version':
- echo '$Revision: 1.226.2.37.2.33
$'."\n";
+ echo '$Revision: 1.226.2.37.2.34
$'."\n";
exit(1);
case 'u':
@@ -474,7 +474,18 @@
}
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;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php