In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/9988b539d419b6c4e886f8919681acc06cd5d04a?hp=199863e7695677ad5c17a1011983f3a2354d23b1>
- Log ----------------------------------------------------------------- commit 9988b539d419b6c4e886f8919681acc06cd5d04a Author: Nicholas Clark <[email protected]> Date: Sun Sep 20 21:46:58 2009 +0100 Move the Makefile targets _test{,_prep,_tty,_notty} into a script runtests. This avoids a recursive call to $(MAKE) in the top level directory, which feels over-complicated when all the targets invoked have no dependencies. ----------------------------------------------------------------------- Summary of changes: MANIFEST | 1 + Makefile.SH | 68 +++++++++++++++++------------------------------------- runtests.SH | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 46 deletions(-) create mode 100644 runtests.SH diff --git a/MANIFEST b/MANIFEST index 47d70e0..ef563d7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4050,6 +4050,7 @@ regexec.c Regular expression evaluator regexp.h Public declarations for the above regnodes.h Description of nodes of RE engine run.c The interpreter loop +runtests.SH A script that generates runtests scope.c Scope entry and exit code scope.h Scope entry and exit header sv.c Scalar value code diff --git a/Makefile.SH b/Makefile.SH index f9f9984..4de1ae3 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -1297,8 +1297,8 @@ depend: makedepend makedepend: makedepend.SH config.sh sh ./makedepend.SH -.PHONY: test check test_prep test_prep_nodll test_prep_pre _test_prep \ - test_tty test-tty _test_tty test_notty test-notty _test_notty \ +.PHONY: test check test_prep test_prep_nodll test_prep_pre \ + test_tty test-tty test_notty test-notty \ utest ucheck test.utf8 check.utf8 test.torture torturetest \ test.utf16 check.utf16 utest.utf16 ucheck.utf16 \ test.third check.third utest.third ucheck.third test_notty.third \ @@ -1308,48 +1308,26 @@ makedepend: makedepend.SH config.sh # Cannot delegate rebuilding of t/perl to make # to allow interlaced test and minitest -TESTFILE=TEST - -_test_prep: - cd t && (rm -f $(PERL)$(EXE_EXT); $(LNS) ../$(PERL)$(EXE_EXT) $(PERL)$(EXE_EXT)) - # Architecture-neutral stuff: test_prep_pre: preplibrary utilities $(nonxs_ext) test_prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL) - PERL=./perl $(MAKE) _test_prep - -_test_tty: - cd t && $(PERL_DEBUG) $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) $(TEST_FILES) </dev/tty - -_test_notty: - cd t && $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) $(TEST_FILES) - -# The second branch is for testing without a tty or controlling terminal, -# see t/op/stat.t -_test: - if (true </dev/tty) >/dev/null 2>&1; then \ - $(MAKE) TEST_ARGS='$(TEST_ARGS)' TESTFILE=$(TESTFILE) _test_tty ; \ - else \ - $(MAKE) TEST_ARGS='$(TEST_ARGS)' TESTFILE=$(TESTFILE) _test_notty ; \ - fi - @echo "Ran tests" > t/rantests test check: test_prep - PERL=./perl $(MAKE) _test + PERL=./perl ./runtests choose test_tty: test_prep - PERL=./perl $(MAKE) _test_tty + PERL=./perl ./runtests tty test_notty: test_prep - PERL=./perl $(MAKE) _test_notty + PERL=./perl ./runtests no-tty utest ucheck test.utf8 check.utf8: test_prep - PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test + PERL=./perl TEST_ARGS=-utf8 ./runtests choose coretest: test_prep - PERL=./perl TEST_ARGS=-core $(MAKE) _test + PERL=./perl TEST_ARGS=-core ./runtests choose test-prep: test_prep @@ -1360,7 +1338,7 @@ test-notty: test_notty # Torture testing test.torture torturetest: test_prep - PERL=./perl TEST_ARGS=-torture $(MAKE) _test + PERL=./perl TEST_ARGS=-torture ./runtests choose # Targets for UTF16 testing: @@ -1369,51 +1347,49 @@ minitest.utf16: minitest.prep && $(LDLIBPTH) $(RUN) ./perl TEST -minitest -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty test.utf16 check.utf16: test_prep - PERL=./perl $(MAKE) TEST_ARGS=-utf16 _test + PERL=./perl TEST_ARGS=-utf16 ./runtests choose utest.utf16 ucheck.utf16: test_prep - PERL=./perl $(MAKE) TEST_ARGS="-utf8 -utf16" _test + PERL=./perl TEST_ARGS="-utf8 -utf16" ./runtests choose # Targets for valgrind testing: test_prep.valgrind: test_prep perl.valgrind - PERL=./perl $(MAKE) _test_prep test.valgrind check.valgrind: test_prep perl.valgrind.config - PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(MAKE) _test + PERL=./perl PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' ./runtests choose utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config - PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 TEST_ARGS=-utf8 $(MAKE) _test + PERL=./perl PERL_VALGRIND=1 TEST_ARGS=-utf8 ./runtests choose test_notty.valgrind: test_prep.valgrind perl.valgrind.config - PERL=./perl $(MAKE) PERL_DEBUG=PERL_VALGRIND=1 _test_notty + PERL=./perl PERL_VALGRIND=1 ./runtests no-tty # Targets for Third Degree testing. test_prep.third: test_prep perl.third - PERL=./perl.third $(MAKE) _test_prep test.third check.third: test_prep.third perl.third - PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 $(MAKE) _test + PERL=./perl.third PERL_3LOG=1 ./runtests choose utest.third ucheck.third: test_prep.third perl.third - PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 TEST_ARGS=-utf8 $(MAKE) _test + PERL=./perl.third PERL_3LOG=1 TEST_ARGS=-utf8 ./runtests choose test_notty.third: test_prep.third perl.third - PERL=./perl.third $(MAKE) PERL_DEBUG=PERL_3LOG=1 _test_notty + PERL=./perl.third PERL_3LOG=1 ./runtests choose # Targets for Deparse testing. test.deparse: test_prep - PERL=./perl TEST_ARGS=-deparse $(MAKE) _test + PERL=./perl TEST_ARGS=-deparse ./runtests choose test_notty.deparse: test_prep - PERL=./perl TEST_ARGS=-deparse $(MAKE) _test_notty + PERL=./perl TEST_ARGS=-deparse ./runtests no-tty # Targets to run the test suite with -t test.taintwarn: test_prep - PERL=./perl TEST_ARGS=-taintwarn $(MAKE) _test + PERL=./perl TEST_ARGS=-taintwarn ./runtests choose minitest.prep: -...@test test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles) @@ -1431,13 +1407,13 @@ minitest: $(MINIPERL_EXE) lib/re.pm minitest.prep # Test via harness test_harness: test_prep - PERL=./perl $(MAKE) TESTFILE=harness _test + PERL=./perl TESTFILE=harness ./runtests choose test_harness_notty: test_prep - PERL=./perl HARNESS_NOTTY=1 $(MAKE) TESTFILE=harness _test + PERL=./perl HARNESS_NOTTY=1 TESTFILE=harness ./runtests choose test-reonly: test_prep - PERL=./perl TEST_ARGS='-re \\bre\\/' $(MAKE) TESTFILE=harness _test + PERL=./perl TEST_ARGS='-re \bre\/' TESTFILE=harness ./runtests choose # Handy way to run perlbug -ok without having to install and run the # installed perlbug. We don't re-run the tests here - we trust the user. diff --git a/runtests.SH b/runtests.SH new file mode 100644 index 0000000..3b0f9b7 --- /dev/null +++ b/runtests.SH @@ -0,0 +1,73 @@ +case $PERL_CONFIG_SH in +'') + if test ! -f config.sh; then + ln ../config.sh . || \ + ln ../../config.sh . || \ + ln ../../../config.sh . || \ + (echo "Can't find config.sh."; exit 1) + fi 2>/dev/null + . ./config.sh + ;; +esac +case "$0" in +*/*) cd `expr X$0 : 'X\(.*\)/'` ;; +esac +echo "Extracting runtests (with variable substitutions)" +rm -f runtests +$spitshell >runtests <<!GROK!THIS! +$startsh -e +# runtests.SH +# + +export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh \$0; kill \$\$) + +case \$# in + 0) + echo "runtests tty_flag ..." + exit 1 + ;; +esac + +if test X"\$PERL" == X; then + echo "please supply PERL in the environment" + exit 1 +fi + +case \$1 in + tty) + tty=Y + ;; + no-tty) + tty=N + ;; + choose) + if (true </dev/tty) >/dev/null 2>&1; then + tty=Y + else + tty=N + fi + ;; + *) + echo "ttyflag should be one of tty, no-tty or choose" + exit 1 + ;; +esac + +if test X"\$TESTFILE" == X; then + TESTFILE=TEST +fi + +cd t +rm -f \$PERL +$lns ../\$PERL \$PERL + +# The second branch is for testing without a tty or controlling terminal, +# see t/op/stat.t +if test \$tty == Y; then + \$PERL \$TESTFILE \$TEST_ARGS \$TEST_FILES </dev/tty +else + PERL_SKIP_TTY_TEST=1 \$PERL \$TESTFILE \$TEST_ARGS \$TEST_FILES +fi +!GROK!THIS! +$eunicefix runtests +chmod +x runtests -- Perl5 Master Repository
