From: Ed Peschko Date: Wed, 29 Apr 1998 21:02:36 +0000 (-0600) Subject: [ PATCH 5.004_64 ] Integrated regression tests for compiler X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=52cebf5efc9883c776f89be24e988c47ceba2a42;p=p5sagit%2Fp5-mst-13.2.git [ PATCH 5.004_64 ] Integrated regression tests for compiler p4raw-id: //depot/perl@963 --- diff --git a/MANIFEST b/MANIFEST index 3e117e8..c4c816d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -910,6 +910,7 @@ utils/perlbug.PL A simple tool to submit a bug report utils/perldoc.PL A simple tool to find & display perl's documentation utils/pl2pm.PL A pl to pm translator utils/splain.PL Stand-alone version of diagnostics.pm +utils/perlcc.PL Front-end for compiler vms/config.vms default config.h for VMS vms/descrip.mms MM[SK] description file for build vms/ext/DCLsym/0README.txt ReadMe file for VMS::DCLsym diff --git a/Makefile.SH b/Makefile.SH index b9c8cdb..a70b53e 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -233,6 +233,12 @@ lintflags = -hbvxac all: $(FIRSTMAKEFILE) miniperl $(private) $(plextract) $(public) $(dynamic_ext) @echo " "; echo " Everything is up to date." +compile: all + echo "testing compilation" > testcompile; + cd utils; $(MAKE) compile; + cd x2p; $(MAKE) compile; + cd pod; $(MAKE) compile; + translators: miniperl lib/Config.pm FORCE @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all @@ -373,6 +379,12 @@ $(plextract): miniperl lib/Config.pm install: all install.perl install.man install.perl: all installperl + if [ -n "$(COMPILE)" ]; \ + then \ + cd utils; $(MAKE) compile; \ + cd ../x2p; $(MAKE) compile; \ + cd ../pod; $(MAKE) compile; \ + fi $(LDLIBPTH) ./perl installperl install.man: all installman @@ -485,6 +497,7 @@ _tidy: -@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) ; do \ sh ext/util/make_ext clean $$x MAKE=$(MAKE) ; \ done + rm -f testcompile compilelog # Do not 'make _cleaner' directly. _cleaner: @@ -503,6 +516,7 @@ _cleaner: rm -f lib/.exists rm -f h2ph.man pstruct rm -rf .config + rm -f testcompile compilelog # The following lint has practically everything turned on. Unfortunately, # you have to wade through a lot of mumbo jumbo that can't be suppressed. diff --git a/installperl b/installperl index b422018..a8bcd35 100755 --- a/installperl +++ b/installperl @@ -38,8 +38,8 @@ while (@ARGV) { umask 022 unless $Is_VMS; @scripts = qw( utils/c2ph utils/h2ph utils/h2xs - utils/perlbug utils/perldoc utils/pl2pm utils/splain - x2p/s2p x2p/find2perl + utils/perlbug utils/perldoc utils/pl2pm utils/splain utils/perlcc + x2p/s2p x2p/find2perl pod/pod2man pod/pod2html pod/pod2latex pod/pod2text); if ($Is_VMS) { @scripts = map { "$_.Com" } @scripts; } @@ -53,6 +53,11 @@ if ($^O eq 'dos') { $archpms{config} = $archpms{filehand} = 1; } +if ((-e "testcompile") && (defined($ENV{'COMPILE'}))) +{ + push(@scripts, map("$_.exe", @scripts)); +} + find(sub { if ("$File::Find::dir/$_" =~ m{^ext/[^/]+/(.*)\.pm$}) { (my $pm = $1) =~ s{^lib/}{}; diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index 8102ff4..e2c47d6 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -68,7 +68,9 @@ sub runtests { my $s = $switches; $s .= q[ "-T"] if $first =~ /^#!.*\bperl.*-\w*T/; $fh->close or print "can't close $test. $!\n"; - my $cmd = "$^X $s $test|"; + my $cmd = ($ENV{'COMPILE_TEST'})? +"./perl -I../lib ../utils/perlcc $test -run -verbose dcf -log ./compilelog |" + : "$^X $s $test|"; $cmd = "MCR $cmd" if $^O eq 'VMS'; $fh->open($cmd) or print "can't run $test. $!\n"; $ok = $next = $max = 0; diff --git a/pod/Makefile b/pod/Makefile index 7eeabd9..e9623a6 100644 --- a/pod/Makefile +++ b/pod/Makefile @@ -9,6 +9,7 @@ POD2HTML = pod2html \ all: $(CONVERTERS) man PERL = ../miniperl +REALPERL = ../perl POD = \ perl.pod \ @@ -240,7 +241,7 @@ toc: clean: rm -f $(MAN) $(HTML) $(TEX) rm -f pod2html-*cache - rm -f *.aux *.log + rm -f *.aux *.log *.exe realclean: clean rm -f $(CONVERTERS) @@ -267,4 +268,7 @@ pod2text: pod2text.PL ../lib/Config.pm checkpods: checkpods.PL ../lib/Config.pm $(PERL) -I ../lib checkpods.PL +compile: all + $(REALPERL) -I../lib ../utils/perlcc -regex 's/$$/.exe/' pod2latex pod2man pod2text checkpods -prog -verbose dcf -log ../compilelog; + diff --git a/t/TEST b/t/TEST index a684b2a..81d5650 100755 --- a/t/TEST +++ b/t/TEST @@ -38,12 +38,34 @@ else { close(CONFIG); } -$bad = 0; -$good = 0; -$total = @ARGV; -$files = 0; -$totmax = 0; -while ($test = shift) { +%infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); + +_testprogs('perl', @ARGV); +_testprogs('compile', @ARGV) if (-e "../testcompile"); + +sub _testprogs +{ + $type = shift @_; + @tests = @_; + + + print " +-------------------------------------------------------------------------------- +TESTING COMPILER +-------------------------------------------------------------------------------- +" if ($type eq 'compile'); + + $bad = 0; + $good = 0; + $total = @tests; + $files = 0; + $totmax = 0; +while ($test = shift @tests) { + + if ( $infinite{$test} && $type eq 'compile' ) { + print STDERR "$test creates infinite loop! Skipping.\n"; + next; + } if ($test =~ /^$/) { next; } @@ -52,7 +74,14 @@ while ($test = shift) { print "$te" . '.' x (18 - length($te)); if ($sharpbang) { -x $test || (print "isn't executable.\n"); - open(RESULTS,"./$test |") || (print "can't run.\n"); + + if ($type eq 'perl') + { open(RESULTS, "./$test |") || (print "can't run.\n"); } + else + { + open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test -run -verbose dcf -log ../compilelog |") + || (print "can't compile.\n"); + } } else { open(SCRIPT,"$test") || die "Can't run $test.\n"; $_ =