perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r30985 - in trunk: languages/perl6/config/makefiles languag

Subject: [svn:parrot] r30985 - in trunk: languages/perl6/config/makefiles languages/perl6/t lib/Parrot/Test
From:
Date: Thu, 11 Sep 2008 07:37:10 -0700 PDT
Newsgroups: perl.cvs.parrot

Author: moritz
Date: Thu Sep 11 07:37:09 2008
New Revision: 30985

Modified:
   trunk/languages/perl6/config/makefiles/root.in
   trunk/languages/perl6/t/harness
   trunk/lib/Parrot/Test/Harness.pm

Log:
Enable parallel testing in rakudo.
Patch courtesy by Michael Schwern and Ron Schmidt


Modified: trunk/languages/perl6/config/makefiles/root.in
==============================================================================
--- trunk/languages/perl6/config/makefiles/root.in      (original)
+++ trunk/languages/perl6/config/makefiles/root.in      Thu Sep 11 07:37:09 2008
@@ -197,21 +197,22 @@
 # NOTE: eventually, we should remove --keep-exit-code and --fudge
 #       as the goal is that all tests must pass without fudge
 HARNESS_WITH_FUDGE = $(PERL) t/harness --fudge --keep-exit-code
+HARNESS_WITH_FUDGE_JOBS = $(HARNESS_WITH_FUDGE) --jobs
 
 spectest: all t/spec
        -cd t/spec && svn up
-       $(HARNESS_WITH_FUDGE) t/spec
+       $(HARNESS_WITH_FUDGE_JOBS) t/spec
 
 # Run the spectests that we know work.
 spectest_regression: all t/spec t/spectest_regression.data
        -cd t/spec && svn up
-       $(HARNESS_WITH_FUDGE) --tests-from-file=t/spectest_regression.data
+       $(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/spectest_regression.data
 
 fulltest: coretest spectest_regression codetest
 
 # Run the tests in t/localtest.data
 localtest: all t/spec t/localtest.data
-       @$(HARNESS_WITH_FUDGE) --tests-from-file=t/localtest.data
+       @$(HARNESS_WITH_FUDGE_JOBS) --tests-from-file=t/localtest.data
 
 # Run the tests in t/localtest.data with a higher verbosity
 localtest_loud: all t/spec t/localtest.data
@@ -220,11 +221,11 @@
 # Run many tests of your choise.
 # make somtests TESTFILES=t/foo/bar
 sometests: all
-       @$(HARNESS_WITH_FUDGE) $(TESTFILES)
+       @$(HARNESS_WITH_FUDGE_JOBS) $(TESTFILES)
 
 # Run a single test
 t/*.t t/*/*.t t/*/*/*.t: all
-       @$(HARNESS_WITH_FUDGE) $@
+       @$(HARNESS_WITH_FUDGE) --verbosity=1 $@
 
 t/localtest.data:
        $(PERL) -MExtUtils::Command -e test_f $@

Modified: trunk/languages/perl6/t/harness
==============================================================================
--- trunk/languages/perl6/t/harness     (original)
+++ trunk/languages/perl6/t/harness     Thu Sep 11 07:37:09 2008
@@ -24,6 +24,9 @@
         'tests-from-file=s' => \my $list_file,
         'fudge'             => \my $do_fudge,
         'verbosity=i'       => \$harness_args{verbosity},
+        # A sensible default is num_cores + 1.
+        # Many people have two cores these days.
+        'jobs:3'            => \$harness_args{jobs},
     );
 
 

Modified: trunk/lib/Parrot/Test/Harness.pm
==============================================================================
--- trunk/lib/Parrot/Test/Harness.pm    (original)
+++ trunk/lib/Parrot/Test/Harness.pm    Thu Sep 11 07:37:09 2008
@@ -166,12 +166,13 @@
     exit unless my @files = get_files(%options);
 
     if (eval { require TAP::Harness; 1 }) {
-        my %opts =
+        my %harness_options =
               $options{exec}     ? ( exec => $options{exec} )
             : $options{compiler} ? ( exec => [ '../../parrot', './' . 
$options{compiler} ] )
             :                      ();
-        $opts{verbosity} = $options{verbosity} ? $options{verbosity} : 0;
-        TAP::Harness->new( \%opts )->runtests( @files );
+        $harness_options{verbosity} = $options{verbosity} ? 
$options{verbosity} : 0;
+        $harness_options{jobs} = $ENV{TEST_JOBS} || $options{jobs} || 1;
+        TAP::Harness->new( \%harness_options )->runtests( @files );
 
         return;
     }

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r30985 - in trunk: languages/perl6/config/makefiles languages/perl6/t lib/Parrot/Test, moritz <=