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

[PATCH] make coretest

Thread Next
From:
Paul Johnson
Date:
August 28, 2001 15:26
Subject:
[PATCH] make coretest
Message ID:
20010829001138.B12169@pjcj.net
Here's something designed to reduce the frustration of waiting for those
loooong tests.  The coretest target runs all the basic tests and the
pragma tests, but doesn't run the module tests.  This takes about a
third of the time of a full test.

No purchase necessary, void where prohibited by law.



--- Makefile.SH.org	Mon Aug 13 15:51:19 2001
+++ Makefile.SH	Tue Aug 28 22:22:43 2001
@@ -941,7 +941,7 @@
 	utest ucheck test.utf8 check.utf8 \
 	test.third check.third utest.third ucheck.third test_notty.third \
 	test.deparse test_notty.deparse \
-	minitest
+	minitest coretest
 
 # Cannot delegate rebuilding of t/perl to make
 # to allow interlaced test and minitest
@@ -985,6 +985,9 @@
 
 utest ucheck test.utf8 check.utf8: test_prep
 	PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test
+
+coretest: test_prep
+	PERL=./perl TEST_ARGS=-core $(MAKE) _test
 
 test-prep:	test_prep
 

--- t/TEST.org	Sun Jul  1 18:25:39 2001
+++ t/TEST	Tue Aug 28 21:35:26 2001
@@ -9,6 +9,7 @@
 if ($#ARGV >= 0) {
     foreach my $idx (0..$#ARGV) {
 	next unless $ARGV[$idx] =~ /^-(\S+)$/;
+	$core    = 1 if $1 eq 'core';
 	$verbose = 1 if $1 eq 'v';
 	$with_utf= 1 if $1 eq 'utf8';
 	if ($1 =~ /^deparse(,.+)?$/) {
@@ -64,15 +65,20 @@
 }
 
 unless (@ARGV) {
-    foreach my $dir (qw(base comp cmd run io op lib)) {
+    foreach my $dir (qw(base comp cmd run io op)) {
         _find_tests($dir);
     }
+    _find_tests("lib") unless $core;
     my $mani = File::Spec->catdir($updir, "MANIFEST");
     if (open(MANI, $mani)) {
         while (<MANI>) { # similar code in t/harness
 	    if (m!^(ext/\S+/([^/]+\.t|test\.pl)|lib/\S+?(\.t|test\.pl))\s!) {
-		push @ARGV, $1;
-		$OVER{$1} = File::Spec->catdir($updir, $1);
+		$t = $1;
+		if (!$core || $t =~ m!^lib/[a-z]!)
+		{
+		    push @ARGV, $t;
+		    $OVER{$t} = File::Spec->catdir($updir, $t);
+		}
 	    }
 	}
     } else {

--- pod/perlhack.pod.org	Tue Aug 28 03:51:34 2001
+++ pod/perlhack.pod	Tue Aug 28 23:13:30 2001
@@ -1709,6 +1709,11 @@
 directory which contains the test.  This causes some problems with the
 tests in F<lib/>, so here's some opportunity for some patching.
 
+If you want to run a quick test, "make coretest" will test everything
+except the modules.  This is useful in that it takes about a third of
+the time of a full test, but is obviously no substitute for the real
+thing before sending a patch.
+
 You must be triply conscious of cross-platform concerns.  This usually
 boils down to using File::Spec and avoiding things like C<fork()> and
 C<system()> unless absolutely necessary.

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

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