From: Stefano Lattarini Date: Fri, 18 May 2012 13:03:49 +0000 (+0200) Subject: Merge branch 'master' into ng/master X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fee394d4df485724bda65e052fcbf03ba41c8dd8;p=thirdparty%2Fautomake.git Merge branch 'master' into ng/master * master: tests: use 'parallel-tests' Automake option by default doc: fix location of Automake's own test-suite.log file yacc tests: avoid a spurious failure with Sun C++ 5.9 self tests: cater for /bin/ksh symlinked to Zsh tests: fix spurious failures due to dpkg install-info + Non-trivial extra edits: * t/check7.sh: look at the contents of '$am_serial_tests', not of '$am_parallel_tests', to decide which kind of testsuite harness is being used. * t/parallel-tests-concatenated-suffix.sh: Don't explicitly set '$am_parallel_tests' to "yes" anymore, is not required and would cause a 'maintainer-check' failure. * t/parallel-tests-dynamic.sh: Likewise. * t/parallel-tests-longest-stem.sh: Likewise. * t/parallel-tests-no-repeat.sh: Likewise. * t/parallel-tests-per-suffix-deps.sh: Likewise. * t/parallel-tests-srcdir-in-test-name.sh: Likewise. Signed-off-by: Stefano Lattarini --- fee394d4df485724bda65e052fcbf03ba41c8dd8 diff --cc doc/automake-ng.texi index 57442c0b9,5928291bb..eb4705c24 --- a/doc/automake-ng.texi +++ b/doc/automake-ng.texi @@@ -12859,14 -12915,12 +12859,14 @@@ which can then be spent on fixing more features. For a bug report, a feature request or other suggestions, please send -email to @email{@value{PACKAGE_BUGREPORT}}. This will then open a new -bug in the @uref{http://debbugs.gnu.org/@/automake, bug tracker}. Be -sure to include the versions of Autoconf and Automake that you use. +email to @email{@value{PACKAGE_BUGREPORT}}. +@c FIXME: we'll need a bug tracker for Automake-NG, sooner or later ... +@c This will then open a new bug in the +@c @uref{http://debbugs.gnu.org/@/automake, bug tracker}. +Be sure to include the versions of Autoconf and Automake-NG that you use. Ideally, post a minimal @file{Makefile.am} and @file{configure.ac} that reproduces the problem you encounter. If you have encountered test - suite failures, please attach the @file{tests/test-suite.log} file. + suite failures, please attach the @file{test-suite.log} file. @c ========================================================== Appendices diff --cc t/README index 8628f1e21,5f967d271..ed39765a9 --- a/t/README +++ b/t/README @@@ -172,13 -173,18 +172,18 @@@ D set-up of a test scenario, you can use the 'framework_fail_' function instead. - For tests that use the 'parallel-tests' Automake-NG option, set the - shell variable 'am_parallel_tests' to "yes" before including ./defs. - For tests that are *not* meant to work with the 'parallel-tests' - Automake-NG option (these should be very very few), set the shell - variable 'am_parallel_tests' to "no" before including ./defs. + For those tests checking the Automake-provided test harnesses that are + expected to work also when the 'serial-tests' Automake option is used + (thus causing the serial testsuite harness to be used in the generated + Makefile), place a line containing "try-with-serial-tests" somewhere + in the file. That will ensure that the 'gen-testsuite-part' script + generates a sibling of that test which uses the serial harness instead + of the parallel one. For those tests that are *not* meant to work with + the parallel testsuite harness at all (these should be very very few), + set the shell variable 'am_serial_tests' to "yes" before including + ./defs. - Some tests in the Automake testsuite are auto-generated; those tests + Some tests in the Automake-NG testsuite are auto-generated; those tests might have custom extensions, but their basename (that is, with such extension stripped) is expected to end with "-w" string, optionally followed by decimal digits. For example, the name of a valid diff --cc t/check-concurrency-bug9245.sh index 87fcadece,1cb842237..177806a7f --- a/t/check-concurrency-bug9245.sh +++ b/t/check-concurrency-bug9245.sh @@@ -44,18 -42,17 +44,14 @@@ $AUTOMAKE - ./configure -# Some make implementations don't grok the '-j' option. -$MAKE -j1 || Exit 77 - for j in '' -j1 -j2; do $MAKE $j check && Exit 1 - TESTS=foo.test $MAKE $j -e check && Exit 1 + $MAKE $j TESTS=foo.test check && Exit 1 - if test x"$am_parallel_tests" = x"yes"; then - $MAKE $j recheck && Exit 1 - $MAKE $j TESTS=foo check && Exit 1 - rm -f test-suite.log - $MAKE $j test-suite.log && Exit 1 - test -f test-suite.log || Exit 1 - else - : # For shells with buggy 'set -e'. - fi + $MAKE $j recheck && Exit 1 - TEST_LOGS=foo.log $MAKE $j -e check && Exit 1 ++ $MAKE $j TESTS=foo check && Exit 1 + rm -f test-suite.log + $MAKE $j test-suite.log && Exit 1 + test -f test-suite.log || Exit 1 done : diff --cc t/check11.sh index 79a040ad2,fc1209c61..9d56a7c02 --- a/t/check11.sh +++ b/t/check11.sh @@@ -39,22 -40,22 +40,22 @@@ $AUTOMAKE - ./configure -env TESTS=skip $MAKE -e check >stdout || { cat stdout; Exit 1; } +$MAKE check TESTS=skip >stdout || { cat stdout; Exit 1; } cat stdout - if test x"$am_parallel_tests" = x"yes"; then - count_test_results total=1 pass=0 fail=0 skip=1 xfail=0 xpass=0 error=0 - else + if test x"$am_serial_tests" = x"yes"; then grep '1.*passed' stdout && Exit 1 : For shells with buggy 'set -e'. + else + count_test_results total=1 pass=0 fail=0 skip=1 xfail=0 xpass=0 error=0 fi -env TESTS="skip skip2" $MAKE -e check >stdout || { cat stdout; Exit 1; } +$MAKE check TESTS="skip skip2" >stdout || { cat stdout; Exit 1; } cat stdout - if test x"$am_parallel_tests" = x"yes"; then - count_test_results total=2 pass=0 fail=0 skip=2 xfail=0 xpass=0 error=0 - else + if test x"$am_serial_tests" = x"yes"; then grep '2.*passed' stdout && Exit 1 : For shells with buggy 'set -e'. + else + count_test_results total=2 pass=0 fail=0 skip=2 xfail=0 xpass=0 error=0 fi : diff --cc t/check7.sh index 962cbe082,54d2b2bd3..5e4cafb38 --- a/t/check7.sh +++ b/t/check7.sh @@@ -59,12 -60,9 +60,12 @@@ $AUTOMAKE - ./configure $MAKE check -EXEEXT=.bin $MAKE -e print-xfail-tests >stdout || { cat stdout; Exit 1; } -cat stdout -$FGREP 'BEG: a.bin b c.bin d.bin :END' stdout + - if test x"$am_parallel_tests" != x"yes"; then ++if test x"$am_serial_tests" = x"yes"; then + $MAKE EXEEXT=.bin print-xfail-tests >stdout || { cat stdout; Exit 1; } + cat stdout + $FGREP 'BEG: a.bin b c.bin d.bin :END' stdout +fi $MAKE distcheck diff --cc t/exeext4.sh index 53c37dfe6,d9099b609..a8595e334 --- a/t/exeext4.sh +++ b/t/exeext4.sh @@@ -17,7 -17,7 +17,7 @@@ # Make sure $(EXEEXT) is appended to programs and to tests that are # programs, but not to @substitutions@. - am_parallel_tests=no -# For gen-testsuite-part: ==> try-with-serial-tests <== ++am_serial_tests=yes . ./defs || Exit 1 cat >> configure.ac << 'END' diff --cc t/maken3.sh index f0d836f82,832bdcf59..5f9981e4a --- a/t/maken3.sh +++ b/t/maken3.sh @@@ -22,8 -24,24 +22,9 @@@ # This test exercises the GCS-mandated targets (except for dist) # as well as tags, TAGS. + # For gen-testsuite-part: ==> try-with-serial-tests <== . ./defs || Exit 1 -# Does $MAKE support the '.MAKE' special target? -have_dotmake=false -if using_gmake; then - have_dotmake=: # GNU make must support it. -else - unindent > mk.tmp << 'END' - targ.tmp: - : > $@ - .MAKE: targ.tmp -END - if $MAKE -n -f mk.tmp targ.tmp && test -f targ.tmp; then - have_dotmake=: - fi -fi - mkdir sub sub2 cat >> configure.ac << 'END' diff --cc t/parallel-tests-concatenated-suffix.sh index 079122226,000000000..11e3f0222 mode 100755,000000..100755 --- a/t/parallel-tests-concatenated-suffix.sh +++ b/t/parallel-tests-concatenated-suffix.sh @@@ -1,76 -1,0 +1,75 @@@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The parallel-tests driver should be able to cope with test scripts +# whose names end with several concatenated suffixes. + - am_parallel_tests=yes +. ./defs || Exit 1 + +cat >> configure.ac << 'END' +AC_OUTPUT +END + +tests='foo.sh foo.t.sh foo.sh.t foo.x.x foo.x.t.sh foo.t.x.sh foo.sh.t.x' + +for t in $tests; do + (echo '#!/bin/sh' && echo 'echo == /$0 ==') > $t + chmod a+x $t +done + +cat > Makefile.am <stdout + $MAKE $j check >>stdout || { cat stdout; Exit 1; } + cat stdout + count_test_results total=7 pass=7 fail=0 skip=0 xfail=0 xpass=0 error=0 + for t in $tests; do grep "^PASS: $t *$" stdout; done + + grep '== .*/foo\.sh ==' foo.log + grep '== .*/foo\.t\.sh ==' foo.t.log + grep '== .*/foo\.sh\.t ==' foo.sh.log + grep '== .*/foo\.x\.x ==' foo.x.log + grep '== .*/foo\.x\.t\.sh ==' foo.x.t.log + grep '== .*/foo\.t\.x\.sh ==' foo.t.x.log + grep '== .*/foo\.sh\.t\.x ==' foo.sh.t.log + + $MAKE $j clean + test ! -f foo.log + test ! -f foo.t.log + test ! -f foo.sh.log + test ! -f foo.x.log + test ! -f foo.x.t.log + test ! -f foo.t.x.log + test ! -f foo.sh.t.log + +done + +: diff --cc t/parallel-tests-dynamic.sh index b94fd1669,000000000..c8b3b8f8d mode 100755,000000..100755 --- a/t/parallel-tests-dynamic.sh +++ b/t/parallel-tests-dynamic.sh @@@ -1,144 -1,0 +1,143 @@@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that dynamic content for $(TESTS) is supported, both when set from +# inside the Makefile.am and when overriddend from the command line. + - am_parallel_tests=yes +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > ok <<'END' +#!/bin/sh +exit 0 +END + +cat > ko <<'END' +#!/bin/sh +exit 1 +END + +cat > er << 'END' +#!/bin/sh +echo $0 should not be run >&2 +exit 99 +END + +chmod a+x ko ok + +mkdir t +cp ok t/nosuffix + +cp ok g1.sh +cp ok g2.sh +cp ok g3.sh +cp ok g4.sh +cp er g5.sh + +cp ok t00-foo.sh +cp ok t02.sh +cp ok t57_mu.sh +cp ok t7311.sh +cp ko t98S.sh +cp ko t99.sh +cp er t1.sh +cp er t9.sh +cp er tx98.sh + +cat > get-tests-list < Makefile.am << 'END' +my_add_dirprefix = $(strip $(1))/$(strip $(2)) +EXTRA_DIST = $(TESTS) get-tests-list +TEST_EXTENSIONS = .sh +TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh) +TESTS += $(shell $(srcdir)/get-tests-list) +TESTS += $(call my_add_dirprefix, t, nosuffix) +XFAIL_TESTS = $(wildcard $(srcdir)/t9[0-9]*.sh) +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure + +$MAKE check > stdout || { cat stdout; Exit 1; } +cat stdout + +count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0 + +grep '^PASS: t/nosuffix$' stdout +grep '^PASS: g1\.sh$' stdout +grep '^PASS: g2\.sh$' stdout +grep '^PASS: g3\.sh$' stdout +grep '^PASS: g4\.sh$' stdout +grep '^PASS: t00-foo\.sh' stdout +grep '^PASS: t02\.sh' stdout +grep '^PASS: t57_mu\.sh' stdout +grep '^PASS: t7311\.sh' stdout +grep '^XFAIL: t98S\.sh' stdout +grep '^XFAIL: t99\.sh' stdout + +$MAKE mostlyclean +test "`find . -name *.log`" = ./config.log + +$MAKE distcheck > stdout || { cat stdout; Exit 1; } +cat stdout +count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0 + +$MAKE check tests1='$(wildcard t00*.sh t98?.sh)' \ + tests2='$(shell ./get-tests-list | sed 1d)' \ + TESTS='$(tests1) $(tests2)' \ + > stdout || { cat stdout; Exit 1; } +cat stdout + +count_test_results total=4 pass=3 fail=0 xpass=0 xfail=1 skip=0 error=0 + +grep '^PASS: g3\.sh$' stdout +grep '^PASS: g4\.sh$' stdout +grep '^PASS: t00-foo\.sh' stdout +grep '^XFAIL: t98S\.sh' stdout + +$MAKE mostlyclean +test "`find . -name *.log`" = ./config.log + +$MAKE check TESTS='$(shell echo t00 | sed "s/$$/-foo/") t99' +test -f t00-foo.log +test -f t99.log + +$MAKE check \ + foo='E9E9E' \ + a='t00.err' \ + b='${a:.err=-foo}' \ + TESTS='$(b) t$(subst E,,$(foo)) $(call my_add_dirprefix,t,nosuffix)' \ + > stdout || { cat stdout; Exit 1; } +cat stdout + +count_test_results total=3 pass=2 fail=0 xpass=0 xfail=1 skip=0 error=0 +grep '^PASS: t/nosuffix' stdout +grep '^PASS: t00-foo\.sh' stdout +grep '^XFAIL: t99\.sh' stdout + +: diff --cc t/parallel-tests-empty-tests.sh index f16095bc1,619eae556..9edd26021 --- a/t/parallel-tests-empty-tests.sh +++ b/t/parallel-tests-empty-tests.sh @@@ -14,9 -14,10 +14,8 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check parallel-tests features: -# - empty TESTS -# - empty TEST_LOGS +# Check parallel-tests features: empty TESTS - am_parallel_tests=yes . ./defs || Exit 1 cat >> configure.ac << 'END' diff --cc t/parallel-tests-logvars-example.sh index fc922a519,60dd7bd50..301eb57d0 --- a/t/parallel-tests-logvars-example.sh +++ b/t/parallel-tests-logvars-example.sh @@@ -15,9 -15,8 +15,8 @@@ # along with this program. If not, see . # Test the example of usage of generic and extension-specific -# LOG_COMPILER and LOG_FLAGS given in the manual. +# LOG_COMPILER, LOG_FLAGS and LOG_DEPENDNECIES given in the manual. - am_parallel_tests=yes required=python . ./defs || Exit 1 diff --cc t/parallel-tests-longest-stem.sh index d93685d54,000000000..a2d06ca32 mode 100755,000000..100755 --- a/t/parallel-tests-longest-stem.sh +++ b/t/parallel-tests-longest-stem.sh @@@ -1,65 -1,0 +1,64 @@@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The parallel-tests driver must prefer tests with an extension to +# extension-less tests. This is required to allow the user to have +# a, say, 'all.test' test case even in the face of the 'all' target. + - am_parallel_tests=yes +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > foo <<'END' +#!/bin/sh +echo "foo without suffix run" >&2 +exit 99 +END + +cat > foo.test <<'END' +#!/bin/sh +echo "$0 has been run" +END +chmod a+x foo.test + +cp foo.test all.test +cp foo.test dist.test +cp foo.test install.test +cp foo.test bad-target.test + +cat > Makefile.am << 'END' +bad-target: + @echo $@ has been run >&2; exit 1 +install-data-local: + @echo $@ has been run >&2; exit 1 +TESTS = foo.test all.test install.test dist.test bad-target.test +EXTRA_DIST = oops-this-does-not-exist +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure --prefix="`pwd`/inst" + +$MAKE check +ls -l # For debugging. +test ! -d inst +for t in foo all install dist bad-target; do + grep "$t\.test has been run" $t.log +done + +: diff --cc t/parallel-tests-no-repeat.sh index c3220c05d,000000000..2c696506a mode 100755,000000..100755 --- a/t/parallel-tests-no-repeat.sh +++ b/t/parallel-tests-no-repeat.sh @@@ -1,44 -1,0 +1,43 @@@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The parallel-tests harness do not cause the same test to be +# uselessly run multiple times. + - am_parallel_tests=yes +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac +echo TESTS = foo.test > Makefile.am + +cat > foo.test <<'END' +#! /bin/sh +ls -l && mkdir bar +END +chmod a+x foo.test + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure + +$MAKE -j1 check || { cat test-suite.log; Exit 1; } +rmdir bar +$MAKE -j2 check || { cat test-suite.log; Exit 1; } +rmdir bar +$MAKE -j4 check || { cat test-suite.log; Exit 1; } + +: diff --cc t/parallel-tests-per-suffix-deps.sh index 496c9f6ef,000000000..d60a609e2 mode 100755,000000..100755 --- a/t/parallel-tests-per-suffix-deps.sh +++ b/t/parallel-tests-per-suffix-deps.sh @@@ -1,163 -1,0 +1,162 @@@ +#! /bin/sh +# Copyright (C) 2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The user should be able to easily specify extra dependencies for +# the test cases, depending on their extension (or lack thereof). +# We do so with the help of "${prefix}LOG_DEPENDENCIES" variables. +# See the last wishlist in automake bug#11287. + - am_parallel_tests=yes +. ./defs || Exit 1 + +cat >> configure.ac <<'END' +AC_SUBST([EXEEXT], [.bin]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +TEST_EXTENSIONS = .test .sh +TESTS = foo.test foo2.test bar.sh baz zard.oz quux.bin mu.test.bin + +TEST_LOG_DEPENDENCIES = test-dep +SH_LOG_DEPENDENCIES = sh-dep1 sh-dep2 +LOG_DEPENDENCIES = dep + +DEPS = test-dep sh-dep1 sh-dep2 dep new-test-dep +$(DEPS): + echo dummy > $@ +CLEANFILES = $(DEPS) + +.PHONY: setup +setup: + chmod a+x $(TESTS) +EXTRA_DIST = $(TESTS) +END + +cat > foo.test <<'END' +#! /bin/sh +test -f test-dep || test -f new-test-dep +END + +cat > foo2.test <<'END' +#! /bin/sh +test -f test-dep +END + +cp foo2.test mu.test.bin + +cat > bar.sh <<'END' +#! /bin/sh +test -f sh-dep1 && test -f sh-dep2 +END + +cat > baz <<'END' +#! /bin/sh +test -f dep +END + +cp baz quux.bin + +cat > zard.oz <<'END' +#! /bin/sh +test -f dep +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +./configure + +$MAKE setup + +cleanup () { rm -f test-dep sh-dep1 sh-dep2 dep; } + +$MAKE check -j4 +test ! -f new-test-dep +test -f test-dep +test -f sh-dep1 +test -f sh-dep2 +test -f dep +test -f quux.log # Sanity check. +test -f mu.log # Likewise. + +cleanup + +$MAKE check TESTS=foo.test +test -f test-dep +test ! -f sh-dep1 +test ! -f sh-dep2 +test ! -f dep + +cleanup +rm -f bar.log +$MAKE check TESTS=bar.sh AM_LAZY_CHECK=yes +test ! -f test-dep +test -f sh-dep1 +test -f sh-dep2 +test ! -f dep + +cleanup +$MAKE check TESTS=baz +test ! -f test-dep +test ! -f sh-dep1 +test ! -f sh-dep2 +test -f dep + +cleanup +$MAKE check TESTS='foo bar' +test -f test-dep +test -f sh-dep1 +test -f sh-dep2 +test ! -f dep + +cleanup +$MAKE check TESTS=zard.oz +test ! -f test-dep +test ! -f sh-dep1 +test ! -f sh-dep2 +test -f dep + +cleanup +$MAKE check TESTS=mu.test.bin +test -f test-dep +test ! -f sh-dep1 +test ! -f sh-dep2 +test ! -f dep + +cleanup +$MAKE check TESTS='quux.bin bar.sh' +test ! -f test-dep +test -f sh-dep1 +test -f sh-dep2 +test -f dep + +cleanup +$MAKE check TESTS=foo TEST_LOG_DEPENDENCIES=new-test-dep +test -f new-test-dep +test ! -f test-dep +test ! -f sh-dep1 +test ! -f sh-dep2 +test ! -f dep + +cleanup +$MAKE check TESTS=baz XFAIL_TESTS=baz LOG_DEPENDENCIES= +test ! -f dep +grep ':test-result: XFAIL' baz.trs + +$MAKE distcheck + +: diff --cc t/parallel-tests-srcdir-in-test-name.sh index 4c834d900,000000000..db81aa6e0 mode 100755,000000..100755 --- a/t/parallel-tests-srcdir-in-test-name.sh +++ b/t/parallel-tests-srcdir-in-test-name.sh @@@ -1,86 -1,0 +1,85 @@@ +#! /bin/sh +# Copyright (C) 2009-2012 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check parallel-tests features: +# - listing $(srcdir)/ or $(top_srcdir)/ in TESTS doesn't work ATM, +# and is thus diagnosed. + +# TODO: this test should also ensure that the 'make' implementation +# properly adheres to rules in all cases. See the Autoconf +# manual for the ugliness in this area, when VPATH comes into +# play. :-/ + - am_parallel_tests=yes +. ./defs || Exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am << 'END' +TESTS = \ + $(srcdir)/foo \ + @srcdir@/foo2 \ + @srcdir@/bar.test \ + ${srcdir}/sub/baz.test \ + built.test + +XFAIL_TESTS = $(srcdir)/bar.test foo2 + +built.test: + (echo '#!/bin/sh' && echo 'exit 77') >$@-t + chmod a-w,a+x $@-t && mv -f $@-t $@ +END + +cat > foo <<'END' +#!/bin/sh +exit 0 +END +chmod a+x foo + +cat > foo2 <<'END' +#!/bin/sh +exit 1 +END +chmod a+x foo2 + +cp foo2 bar.test + +mkdir sub +cp foo sub/baz.test + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -a + +mkdir build +cd build +../configure +$MAKE check + +ls -l . .. # For debugging. + +test -f built.log +test -f foo.log +test -f bar.log +test -f sub/baz.log +test -f test-suite.log + +test ! -f ../built.log +test ! -f ../foo.log +test ! -f ../bar.log +test ! -f ../sub/baz.log +test ! -f ../test-suite.log + +: diff --cc t/parallel-tests.sh index 538ee7550,459a24daf..2530134ce --- a/t/parallel-tests.sh +++ b/t/parallel-tests.sh @@@ -19,10 -19,10 +19,9 @@@ # - log files, and what goes in 'test-suite.log' # - make clean # - dependencies between tests -# - TESTS redefinition at runtime -# - TEST_LOGS redefinition at runtime -# - RECHECK_LOGS redefinition at runtime +# - TESTS redefinition at runtime (with and without test suffixes) +# - AM_LAZY_CHECK - am_parallel_tests=yes . ./defs || Exit 1 cat >> configure.ac << 'END' diff --cc t/parallel-tests5.sh index 62256e0a5,bb5a876ab..4c01560be --- a/t/parallel-tests5.sh +++ b/t/parallel-tests5.sh @@@ -20,8 -20,7 +20,7 @@@ # Actually, this test doesn't ensure that things happen concurrently. # It merely serves as demonstration. :-) - am_parallel_tests=yes -required='cc native GNUmake' +required='cc native' . ./defs || Exit 1 cat >> configure.ac << 'END' diff --cc t/parallel-tests6.sh index 76ba5962e,46b455c0e..94b464d5d --- a/t/parallel-tests6.sh +++ b/t/parallel-tests6.sh @@@ -16,11 -16,10 +16,10 @@@ # Check parallel-tests features: # - empty TESTS -# BSD make will expand '$(TESTS:=.log)' to '.log' unless overridden. # See parallel-tests10.test for a similar issue. - am_parallel_tests=yes . ./defs || Exit 1 + cat >> configure.ac << 'END' AC_OUTPUT END diff --cc t/parallel-tests8.sh index 46e412047,7363929d3..4f322319a --- a/t/parallel-tests8.sh +++ b/t/parallel-tests8.sh @@@ -14,9 -14,16 +14,8 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Check parallel-tests features: -# - generated distributed tests. -# - listing $(srcdir)/ or $(top_srcdir)/ in TESTS doesn't work ATM, -# and is thus diagnosed. - -# TODO: this test should also ensure that the 'make' implementation -# properly adheres to rules in all cases. See the Autoconf -# manual for the ugliness in this area, when VPATH comes into -# play. :-/ +# Check parallel-tests features: generated distributed tests. - am_parallel_tests=yes . ./defs || Exit 1 cat >> configure.ac << 'END' diff --cc t/tap-common-setup.sh index cd0a14d62,8400da04b..b4026d5c1 --- a/t/tap-common-setup.sh +++ b/t/tap-common-setup.sh @@@ -16,15 -16,9 +16,14 @@@ # Auxiliary test to set up common data used by many tests on TAP support. - am_parallel_tests=yes . ./defs || Exit 1 -cat >> configure.ac << END +cat >> configure.ac << 'END' +# FIXME: must define this otherwise automake will require the presence +# FIXME: of the 'test-driver' script. This issue should be documented +# FIXME: in the manual ... +AC_SUBST([LOG_DRIVER], + ['$(error LOG_DRIVER should be never used) false']) AC_OUTPUT END diff --cc t/tap-lazy-check.sh index de92c3d6b,7fb2b807f..408646a85 --- a/t/tap-lazy-check.sh +++ b/t/tap-lazy-check.sh @@@ -14,9 -14,9 +14,8 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# TAP support: -# - RECHECK_LOGS +# TAP support: AM_LAZY_CHECK - am_parallel_tests=yes . ./defs || Exit 1 cat > Makefile.am << 'END' diff --cc t/test-driver-custom-multitest-recheck2.sh index 9eb8f8d37,5ceb3393a..c1df52b52 --- a/t/test-driver-custom-multitest-recheck2.sh +++ b/t/test-driver-custom-multitest-recheck2.sh @@@ -16,10 -16,11 +16,9 @@@ # Custom test drivers: try the "recheck" functionality with test protocols # that allow multiple testcases in a single test script. In particular, -# check that this still works when we override $(TESTS) and $(TEST_LOGS) -# at make runtime. -# See also related tests 'test-driver-custom-multitest-recheck.test' and -# 'parallel-tests-recheck-override.test'. +# check that this still works when we override $(TESTS) at make runtime. +# See also related tests 'test-driver-custom-multitest-recheck.test'. - am_parallel_tests=yes . ./defs || Exit 1 cp "$am_testauxdir"/trivial-test-driver . \ diff --cc t/test-missing.sh index 7ede22425,2491da5b3..115aed93a --- a/t/test-missing.sh +++ b/t/test-missing.sh @@@ -14,9 -14,10 +14,8 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# parallel-tests: -# - non-existent scripts listed in TESTS get diagnosed -# See also related test 'test-missing2.test'. +# parallel-tests: non-existent scripts listed in TESTS get diagnosed. - am_parallel_tests=yes . ./defs || Exit 1 cat >> configure.ac << 'END' diff --cc t/test-trs-recover-parallel.sh index 0a03bdfdf,801300bd7..fd8d18312 --- a/t/test-trs-recover-parallel.sh +++ b/t/test-trs-recover-parallel.sh @@@ -14,47 -14,44 +14,46 @@@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# parallel-tests support: the following are registered with '.SUFFIXES': -# - .log -# - .trs (used by files that store test results and metadata) -# - .test if $(TEST_EXTENSIONS) is not defined -# - stuff in $(TEST_EXTENSIONS) otherwise +# Check parallel harness features: +# - recovery from deleted '.log' and '.trs' files, with parallel make - am_parallel_tests=yes . ./defs || Exit 1 -: > Makefile.am +all= log= trs= +for i in 1 2 3 4 5 6 7 8 9 10 11 12; do + all="$all $i" log="$log $i" trs="$trs $i" +done -cat > 1.am << 'END' -TESTS = -END +echo AC_OUTPUT >> configure.ac +echo TESTS = > Makefile.am -cat > 2.am << 'END' -TEST_EXTENSIONS = .SH .abcdef -TESTS = -END +for i in $all; do + echo TESTS += $i.test >> Makefile.am + (echo "#!/bin/sh" && echo "mkdir $i.d") > $i.test + chmod a+x $i.test +done -: > test-driver +ls -l # For debugging. $ACLOCAL - -$AUTOMAKE 1 -$AUTOMAKE 2 - -sed -e 's/$/ /' 1.in > mk.1 -sed -e 's/$/ /' 2.in > mk.2 - -grep '^\.SUFFIXES:' mk.1 -grep '^\.SUFFIXES:' mk.2 - -for suf in test log trs; do - grep "^\\.SUFFIXES:.* \\.$suf " mk.1 -done - -for suf in SH abcdef log trs; do - grep "^\\.SUFFIXES:.* \\.$suf " mk.2 +$AUTOCONF +$AUTOMAKE -a + +./configure + +: Create the required log files. +$MAKE check + +for n in 1 2 5 7 12; do + for suf in log trs; do + rmdir *.d + rm -f *.$suf + $MAKE -j$n check + for f in $all; do + test -f $f.log + test -f $f.trs + done + done done :