This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(patch blead) Extend t/harness to allow filtering of the file list by regex.
authorYves Orton <demerphq@gmail.com>
Sat, 19 Feb 2005 11:10:00 +0000 (12:10 +0100)
committerSteve Hay <SteveHay@planit.com>
Wed, 23 Feb 2005 13:36:59 +0000 (13:36 +0000)
Message-ID: <9b18b3110502190210105decf4@mail.gmail.com>

p4raw-id: //depot/perl@23993

t/harness

index 4fc7746..e3e02f5 100644 (file)
--- a/t/harness
+++ b/t/harness
@@ -54,6 +54,16 @@ sub _populate_hash {
     return map {$_, 1} split /\s+/, $_[0];
 }
 
+if ($ARGV[0]=~/^-re/) {
+    if ($ARGV[0]!~/=/) {
+        shift;
+        $re=join "|",@ARGV;
+        @ARGV=();
+    } else {
+        (undef,$re)=split/=/,shift;
+    }
+}
+
 if (@ARGV) {
     if ($^O eq 'MSWin32') {
        @tests = map(glob($_),@ARGV);
@@ -108,6 +118,8 @@ if (@ARGV) {
 if ($^O eq 'MSWin32') {
     s,\\,/,g for @tests;
 }
+@tests=grep /$re/, @tests 
+    if $re;
 Test::Harness::runtests @tests;
 exit(0) unless -e "../testcompile";