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

[svn:parrot] r24989 - in trunk: languages/t lib/Parrot/Test

Subject: [svn:parrot] r24989 - in trunk: languages/t lib/Parrot/Test
From:
Date: Fri, 18 Jan 2008 21:28:48 -0800 PST
Newsgroups: perl.cvs.parrot

Author: particle
Date: Fri Jan 18 21:28:47 2008
New Revision: 24989

Modified:
   trunk/languages/t/harness
   trunk/lib/Parrot/Test/Harness.pm

Log:
[lib]: modify Parrot::Test::Harness to allow a language to better specify which 
files it wants to run
~ also modify languages test harness to use new Parrot::Test::Harness code

Modified: trunk/languages/t/harness
==============================================================================
--- trunk/languages/t/harness   (original)
+++ trunk/languages/t/harness   Fri Jan 18 21:28:47 2008
@@ -123,7 +123,7 @@
 my @tests;
 foreach my $harness (@harnesses) {
     my $perl = "$^X -I" . File::Spec->join(File::Spec->updir(), 'lib');
-    open(FILES, "$perl $harness --files |");  
+    open(FILES, "$perl $harness --files --master |");  
     push @tests, <FILES>;
     close(FILES);
 }

Modified: trunk/lib/Parrot/Test/Harness.pm
==============================================================================
--- trunk/lib/Parrot/Test/Harness.pm    (original)
+++ trunk/lib/Parrot/Test/Harness.pm    Fri Jan 18 21:28:47 2008
@@ -22,7 +22,11 @@
 
   # or
 
-  use Parrot::Test::Harness language => 'eclectus', exec => [ 'petite', 
'--script' ], files => [ 't/*.pl' ];
+  use Parrot::Test::Harness
+      language => 'eclectus',
+      exec => [ 'petite', '--script' ],
+      arguments => [ '--files' ],
+      files     => [ 't/*.pl' ];
 
 That's it. Seriously.
 
@@ -110,7 +114,11 @@
                     :
                     ( 't/*.t', 't/*/*.t' );
             foreach ( @file_patterns ) {
-                push @files, glob( File::Spec->catfile( $options{language}, $_ 
 ) ),
+                # if --master is passed, add the language dir as a prefix
+                my $prefix = ( grep { /^--master$/ } @{ $options{arguments} } )
+                    ? $options{language}
+                    : '';
+                push @files, glob( File::Spec->catfile( $prefix . $_  ) ),
             }
         }
         print join( "\n", @files );

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r24989 - in trunk: languages/t lib/Parrot/Test, particle <=