This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/harness can run the tests lib/*.t in parallel with each other.
authorNicholas Clark <nick@ccl4.org>
Wed, 1 Sep 2010 13:32:47 +0000 (14:32 +0100)
committerNicholas Clark <nick@ccl4.org>
Wed, 1 Sep 2010 14:00:54 +0000 (15:00 +0100)
All these tests are for different modules, and should be capable of running
in parallel. Hopefully this will reduce the chance of seeing lib/warnings.t
running all alone on a multi-core machine.

t/harness

index 88a7bfa..d9dac05 100644 (file)
--- a/t/harness
+++ b/t/harness
@@ -177,7 +177,8 @@ if (@ARGV) {
            if ($^O eq 'MSWin32') {
                s,\\,/,g; # canonicalize path
            };
-           m!(.*[/])! or die "'$_'";
+           # Treat every file matching lib/*.t as a "directory"
+           m!\A(\.\./lib/[^/]+\.t\z|.*[/])! or die "'$_'";
            push @{$dir{$1}}, $_;
            $total_time{$1} += $times{$_} || 0;
        }
@@ -186,7 +187,7 @@ if (@ARGV) {
 
        # Generate T::H schedule rules that run the contents of each directory
        # sequentially.
-       push @seq, { par => [ map { { seq => "$_*" } } sort {
+       push @seq, { par => [ map { s!/$!/*!; { seq => $_ } } sort {
            # Directories, ordered by total time descending then name ascending
            $total_time{$b} <=> $total_time{$a} || $a cmp $b
        } keys %dir ] };