Change the scan policy of the *.t and test.pl files,
[p5sagit/p5-mst-13.2.git] / t / harness
index 3cacc59..e5ec0d6 100644 (file)
--- a/t/harness
+++ b/t/harness
@@ -36,8 +36,23 @@ foreach (keys %datahandle) {
      unlink "$_.t";
 }
 
-@tests = @ARGV;
-@tests = <base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t lib/*.t pod/*.t> unless @tests;
+if (@ARGV) {
+    @tests = @ARGV;
+} else {
+    @tests = <base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t lib/*.t pod/*.t> unless @tests;
+    use File::Spec;
+    my $updir = File::Spec->updir;
+    my $mani  = File::Spec->catdir(File::Spec->updir, "MANIFEST");
+    if (open(MANI, $mani)) {
+        while (<MANI>) { # similar code in t/TEST
+           if (m!^(ext/.+/([^/]+\.t|test\.pl)|lib/.+(\.t|test\.pl))\s!) {
+               push @tests, File::Spec->catdir($updir, $1);
+           }
+       }
+    } else {
+        warn "$0: cannot open $mani: $!\n";
+    }
+}
 
 Test::Harness::runtests @tests;
 exit(0) unless -e "../testcompile";