develooper Front page | perl.perl5.porters | Postings from October 2001

[PATCH] make minitest

Thread Next
From:
Nicholas Clark
Date:
October 27, 2001 14:56
Subject:
[PATCH] make minitest
Message ID:
20011027225616.L20275@plum.flirble.org
There's been a recent thread on this, hasn't there? [that I've now deleted]

Anyway this is wrong, isn't it:

$ make minitest
You may see some irrelevant test failures if you have been unable
to build lib/Config.pm.
cd t && (rm -f perl; /bin/ln -s ../miniperl perl) \
        &&  ./perl TEST base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t </dev/tty
Can't locate Config.pm in @INC (@INC contains: ../lib) at TEST line 318.
BEGIN failed--compilation aborted at TEST line 318.
make: [minitest] Error 2 (ignored)

minitest (and TEST) should still work even if miniperl was too sickly to
make lib/Config.pm? If so, suggested patch, which seems to work with or
without lib/Config.pm present. (and does give the helpful hints when it is)

Nicholas Clark

--- t/TEST.orig	Thu Oct 25 18:27:53 2001
+++ t/TEST	Sat Oct 27 22:47:23 2001
@@ -315,30 +315,32 @@
    ###     ./perl harness
    ### in the 't' directory since most (>=80%) of the tests succeeded.
 SHRDLU
-	use Config;
-	if (my $p = $Config{ldlibpthname}) {
-	    warn <<SHRDLU;
+	# TEST must still work even if lib/Config.pm hasn't been made
+	if (eval {require Config; import Config; 1}) {
+            if (my $p = $Config{ldlibpthname}) {
+                warn <<SHRDLU;
    ### You may have to set your dynamic library search path,
    ### $p, to point to the build directory:
 SHRDLU
-           if (exists $ENV{$p}) {
-	       warn <<SHRDLU;
+                if (exists $ENV{$p}) {
+                    warn <<SHRDLU;
    ###     setenv $p `pwd`:\$$p; cd t; ./perl harness
    ###     $p=`pwd`:\$$p; export $p; cd t; ./perl harness
    ###     export $p=`pwd`:\$$p; cd t; ./perl harness
 SHRDLU
-            } else {
-		warn <<SHRDLU;
+                } else {
+                    warn <<SHRDLU;
    ###     setenv $p `pwd`; cd t; ./perl harness
    ###     $p=`pwd`; export $p; cd t; ./perl harness
    ###     export $p=`pwd`; cd t; ./perl harness
 SHRDLU
-            }    
-	    warn <<SHRDLU;
+                }
+                warn <<SHRDLU;
    ### for csh-style shells, like tcsh; or for traditional/modern
    ### Bourne-style shells, like bash, ksh, and zsh, respectively.
 SHRDLU
-	}
+            }
+        }
     }
     ($user,$sys,$cuser,$csys) = times;
     print sprintf("u=%g  s=%g  cu=%g  cs=%g  scripts=%d  tests=%d\n",

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About