This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Converted t/op/pos.t to use test.pl and added TODO test for
[perl5.git] / t / harness
index 4fc7746..b5e3e87 100644 (file)
--- a/t/harness
+++ b/t/harness
@@ -16,7 +16,7 @@ use Test::Harness;
 $Test::Harness::switches = "";    # Too much noise otherwise
 $Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v';
 
-if ($ARGV[0] eq '-torture') {
+if ($ARGV[0] && $ARGV[0] eq '-torture') {
     shift;
     $torture = 1;
 }
@@ -54,6 +54,16 @@ sub _populate_hash {
     return map {$_, 1} split /\s+/, $_[0];
 }
 
+if ($ARGV[0] && $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";