This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Partial minitest fix-up
authorFather Chrysostomos <sprout@cpan.org>
Sun, 24 Aug 2014 06:22:26 +0000 (23:22 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 24 Aug 2014 06:33:13 +0000 (23:33 -0700)
While minitest passes all its tests when everything has been
built, it is sometimes useful to run it when nothing has been
built but miniperl (especially when one is working on low-level
stuff that breaks miniperl).  Many tests fail if things have
not been built yet because miniperl can’t find modules like
re.pm.  This patch fixes up some tests to find those modules
and changes _charnames.pm to load File::Spec only when it
needs it.

There are still many more failures, but I’ll leave the rest
for another time (or another hacker :-).

lib/_charnames.pm
t/comp/hints.t
t/comp/require.t
t/re/overload.t
t/re/pat.t
t/re/reg_mesg.t
t/re/regex_sets.t
t/re/regexp.t

index 92286c2..b27fd05 100644 (file)
@@ -6,7 +6,6 @@
 package _charnames;
 use strict;
 use warnings;
-use File::Spec;
 our $VERSION = '1.41';
 use unicore::Name;    # mktables-generated algorithmically-defined names
 
@@ -237,6 +236,7 @@ sub not_legal_use_bytes_msg {
 
 sub alias_file ($)  # Reads a file containing alias definitions
 {
+  require File::Spec;
   my ($arg, $file) = @_;
   if (-f $arg && File::Spec->file_name_is_absolute ($arg)) {
     $file = $arg;
index 9a08854..391287c 100644 (file)
@@ -3,7 +3,7 @@
 # Tests the scoping of $^H and %^H
 
 BEGIN {
-    @INC = qw(. ../lib);
+    @INC = qw(. ../lib ../ext/re);
     chdir 't';
 }
 
index 4eafce4..f817527 100644 (file)
@@ -3,7 +3,7 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '.';
-    push @INC, '../lib';
+    push @INC, '../lib', '../ext/re';
 }
 
 sub do_require {
index dba0357..ee821f1 100644 (file)
@@ -2,7 +2,7 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = '../lib';
+    @INC = qw '../lib ../ext/re';
     require './test.pl';
 }
 
index 62ce76a..ec4eea0 100644 (file)
@@ -15,7 +15,7 @@ $| = 1;
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = ('../lib','.');
+    @INC = ('../lib','.','../ext/re');
     require Config; import Config;
     require './test.pl';
 }
index 2c54cc3..d4df2ec 100644 (file)
@@ -2,7 +2,7 @@
 
 BEGIN {
        chdir 't' if -d 't';
-       @INC = '../lib';
+       @INC = qw '../lib ../ext/re';
        require './test.pl';
        eval 'require Config'; # assume defaults if this fails
 }
index 9ddceae..2df6148 100644 (file)
@@ -12,7 +12,7 @@ $| = 1;
 
 BEGIN {
     chdir 't' if -d 't';
-    @INC = ('../lib','.');
+    @INC = ('../lib','.','../ext/re');
     require './test.pl';
 }
 
index ac211ca..fd1da7c 100644 (file)
@@ -59,7 +59,7 @@ BEGIN {
     }
 
     chdir 't' if -d 't';
-    @INC = '../lib';
+    @INC = qw '../lib ../ext/re';
 
 }