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

[PATCH: perl@11523] fixups for t/harness

Thread Next
From:
Prymmer/Kahn
Date:
August 1, 2001 09:24
Subject:
[PATCH: perl@11523] fixups for t/harness
Message ID:
Pine.BSF.4.21.0108010910310.17655-100000@shell8.ba.best.com

Greetings,

One possible aspect of turning the perl regression test suite into
an installation verification procedure could make use of recycling
the files in t/*.  Unfortunately early experiments with such a procedure
uncovered some incorrect function calls in the t/harness script.  Although
calling catdir() rather than catfile() will work on Unix and Win32 it will
not work on VMS (and I suspect it will not work on Mac OS either).
The problem can be illustrated via the MANIFEST result: on VMS without
this patch harness attempts to open [-.MANIFEST] which is a directory
specification, rather than [-]MANIFEST which is a file specification.
The unportable file globbing has been replaced with a bunch of separate
pushes of individual globs.  This does not render t/harness completely
useful for running the tests on VMS, but it is a step in the right
direction (other bits would probably entail modifications to vms/test.com
rather than t/harness).

Please make careful note that this patch will still run the same tests on
e.g. win32 but that the `nmake test` output rather than looking like this:

..\ext\B\B............................ok
..\ext\B\Debug........................ok

will instead now look like this:

..\ext/B/B............................ok
..\ext/B/Debug........................ok

that is with forward slashes.  If that aesthetic change is unpalatable
then perhaps changing File::Spec::Win32.pm is in order?

--- harness.orig	Tue Jul 31 23:09:10 2001
+++ harness	Tue Jul 31 23:09:04 2001
@@ -5,10 +5,9 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    @INC = '../lib';              # pick up only this build's lib
     $ENV{PERL5LIB} = '../lib';    # so children will see it too
 }
-use lib '../lib';
 
 use Test::Harness;
 
@@ -35,18 +34,26 @@
      unlink "$_.t";
 }
 
+my @tests = ();
+
 if (@ARGV) {
     @tests = @ARGV;
 } else {
     unless (@tests) {
-	@tests = <base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t lib/*.t>;
+	push @tests, <base/*.t>;
+        push @tests, <comp/*.t>;
+        push @tests, <cmd/*.t>;
+        push @tests, <run/*.t>;
+        push @tests, <io/*.t>;
+        push @tests, <op/*.t>;
+        push @tests, <lib/*.t>;
 	use File::Spec;
 	my $updir = File::Spec->updir;
-	my $mani  = File::Spec->catdir(File::Spec->updir, "MANIFEST");
+	my $mani  = File::Spec->catfile(File::Spec->updir, "MANIFEST");
 	if (open(MANI, $mani)) {
 	    while (<MANI>) { # similar code in t/TEST
 	    if (m!^(ext/\S+/([^/]+\.t|test\.pl)|lib/\S+?(\.t|test\.pl))\s!) {
-		    push @tests, File::Spec->catdir($updir, $1);
+		    push @tests, File::Spec->catfile($updir, $1);
 		}
 	    }
 	} else {
End of Patch.

Peter Prymmer




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