This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add another exception to dual-life.t
authorFather Chrysostomos <sprout@cpan.org>
Mon, 3 Oct 2011 00:56:51 +0000 (17:56 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 3 Oct 2011 00:56:51 +0000 (17:56 -0700)
Module::Build’s tests create a file named something like

    cpan/Module-Build/MB-rrWnCs8O/Simple/bin/foo.PL

during testing, causing dual-life.t to fail when testing in
parallel.

This commit adds that to the list of exceptions, but since the
exact name can vary, it changes the exception list into a
regular expression.

t/porting/dual-life.t

index 90258ae..f1a18a7 100644 (file)
@@ -14,14 +14,13 @@ use File::Basename;
 use File::Find;
 use File::Spec::Functions;
 
-# Exceptions are found in dual-life bin dirs but aren't
-# installed by default
-my @not_installed = qw(
-  ../cpan/Encode/bin/ucm2table
-  ../cpan/Encode/bin/ucmlint
-  ../cpan/Encode/bin/ucmsort
-  ../cpan/Encode/bin/unidump
-);
+# Exceptions that are found in dual-life bin dirs but aren't
+# installed by default; some occur only during testing:
+my $not_installed = qr{^(?:
+  \.\./cpan/Encode/bin/u(?:cm(?:2table|lint|sort)|nidump)
+   |
+  \.\./cpan/Module-Build/MB-[\w\d]+/Simple/bin/foo\.PL
+)\z}ix;
 
 my %dist_dir_exe;
 
@@ -50,7 +49,7 @@ my $ext = $^O eq 'VMS' ? '.com' : '';
 
 for my $f ( @programs ) {
   $f =~ s/\.\z// if $^O eq 'VMS';
-  next if qr/(?i:$f)/ ~~ @not_installed;
+  next if $f =~ $not_installed;
   $f = basename($f);
   if(qr/\A(?i:$f)\z/ ~~ %dist_dir_exe) {
     ok( -f "$dist_dir_exe{lc $f}$ext", "$f$ext");