From: Stefano Lattarini Date: Mon, 21 May 2012 23:48:52 +0000 (+0200) Subject: [ng] check: unconditionally distribute test-driver X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c64f4c94278dbb66b33aeb3c396c6b1fd04387a;p=thirdparty%2Fautomake.git [ng] check: unconditionally distribute test-driver This new behaviour is suboptimal, but will allow us to move yet more logic and processing from the automake scripts into the generated Makefiles. * automake.in (handle_tests): Distribute 'test-driver' unconditionally if the variable TESTS is defined and the 'serial-tests' option is not used. (handle_per_suffix_test): Don't distribute 'test-driver' anymore. * Several tests: Adjust. * t/test-driver-custom-no-extra-driver.sh: Remove as obsolete. Signed-off-by: Stefano Lattarini --- diff --git a/automake.in b/automake.in index db0fe586b..5138cf54a 100644 --- a/automake.in +++ b/automake.in @@ -4584,7 +4584,6 @@ sub handle_per_suffix_test($) # auxiliary script. if (! var "${pfx}LOG_DRIVER") { - require_conf_file ("parallel-tests", FOREIGN, 'test-driver'); define_variable ("${pfx}LOG_DRIVER", '$(SHELL) $(am__config_aux_dir)/test-driver', INTERNAL); @@ -4645,6 +4644,7 @@ sub handle_tests my $suff = '.test'; define_variable ('TEST_EXTENSIONS', '.test', INTERNAL) if (! var 'TEST_EXTENSIONS'); + require_conf_file ("parallel-tests", FOREIGN, 'test-driver'); my $var = var 'TEST_EXTENSIONS'; # Currently, we are not able to deal with conditional contents # in TEST_EXTENSIONS. diff --git a/t/tap-bad-prog.tap b/t/tap-bad-prog.tap index 260932914..ff7794abd 100755 --- a/t/tap-bad-prog.tap +++ b/t/tap-bad-prog.tap @@ -29,9 +29,8 @@ AC_OUTPUT END cat > Makefile.am << 'END' -LOG_DRIVER = $(srcdir)/tap-driver -TEST_LOG_DRIVER = $(LOG_DRIVER) -TESTS = none.test noread noexec.test +TEST_LOG_DRIVER = $(srcdir)/tap-driver +TESTS = none.test noread.test noexec.test none.test: END @@ -41,12 +40,12 @@ echo 1..1 echo ok 1 END -cp noexec.test noread -chmod a-r noread +cp noexec.test noread.test +chmod a-r noread.test $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure @@ -72,10 +71,10 @@ else fi desc="non-readable test is reported" -if test -r noread; then +if test -r noread.test; then skip_ -r "any file is readable" "$desc" else - command_ok_ "$desc" -- grep '^ERROR: noread' stdout + command_ok_ "$desc" -- grep '^ERROR: noread\.test' stdout fi # Check that no spurious test result is reported. This is lower-priority diff --git a/t/tap-basic.sh b/t/tap-basic.sh index 60a3c7f87..09901c770 100755 --- a/t/tap-basic.sh +++ b/t/tap-basic.sh @@ -46,8 +46,6 @@ ok.test: echo 'ok 3 # SKIP' >>$@-t cat $@-t ;: For debugging. mv -f $@-t $@ - -LOG_DRIVER = false # Dummy but required. END cat > success.test << 'END' @@ -74,6 +72,13 @@ ok 19 - nineteen # SKIP ok 20 twenty twenty # SKIP END +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + $ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/tap-common-setup.sh b/t/tap-common-setup.sh index b4026d5c1..f76ce3b08 100755 --- a/t/tap-common-setup.sh +++ b/t/tap-common-setup.sh @@ -18,14 +18,7 @@ . ./defs || Exit 1 -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 +echo AC_OUTPUT >> configure.ac cat > Makefile.am << 'END' TEST_LOG_DRIVER = $(srcdir)/tap-driver @@ -33,10 +26,16 @@ TEST_LOG_COMPILER = cat TESTS = all.test END +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + $ACLOCAL $AUTOCONF $AUTOMAKE -test ! -f test-driver ./configure diff --git a/t/tap-diagnostic-custom.sh b/t/tap-diagnostic-custom.sh index d1a4f98d5..afe0c0083 100755 --- a/t/tap-diagnostic-custom.sh +++ b/t/tap-diagnostic-custom.sh @@ -31,7 +31,6 @@ my_log_driver = $(srcdir)/tap-driver my_log_compiler = cat TEST_EXTENSIONS = TESTS = -LOG_DRIVER = $(error LOG_DRIVER is dummy, required, never extended) END : > later.mk @@ -78,7 +77,7 @@ done $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure diff --git a/t/tap-more.sh b/t/tap-more.sh index 5949e15a7..014f347cc 100755 --- a/t/tap-more.sh +++ b/t/tap-more.sh @@ -40,6 +40,13 @@ TESTS = 1.test 2.test 3.test EXTRA_DIST = $(TESTS) tap-driver END +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + cat > 1.test <<'END' #! /bin/sh echo 1..2 diff --git a/t/tap-more2.sh b/t/tap-more2.sh index b34e3c18d..9ac5c1164 100755 --- a/t/tap-more2.sh +++ b/t/tap-more2.sh @@ -77,7 +77,7 @@ END $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE --add-missing ./configure diff --git a/t/tap-recheck.sh b/t/tap-recheck.sh index 2416c6a6e..e689c2c54 100755 --- a/t/tap-recheck.sh +++ b/t/tap-recheck.sh @@ -81,7 +81,7 @@ chmod a+x *.test $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a do_recheck () { diff --git a/t/test-driver-acsubst.sh b/t/test-driver-acsubst.sh index e384ac792..06c9a114b 100755 --- a/t/test-driver-acsubst.sh +++ b/t/test-driver-acsubst.sh @@ -26,6 +26,13 @@ cp "$am_testauxdir"/trivial-test-driver test-drivers/triv \ cp "$am_scriptdir"/test-driver test-drivers/dflt \ || fatal_ "failed to fetch auxiliary script test-driver" +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + cat >> configure.ac <<'END' AC_SUBST([LOG_DRIVER], ['${SHELL} test-drivers/triv']) AC_SUBST([TEST_LOG_DRIVER], ['${SHELL} test-drivers/dflt']) diff --git a/t/test-driver-create-log-dir.sh b/t/test-driver-create-log-dir.sh index dc8e6811f..b74809343 100755 --- a/t/test-driver-create-log-dir.sh +++ b/t/test-driver-create-log-dir.sh @@ -71,6 +71,13 @@ echo dummy2 > "$trs_file" END chmod a+x checkdir-driver +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + $ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/test-driver-custom-multitest.sh b/t/test-driver-custom-multitest.sh index 19acd9860..291c95f22 100755 --- a/t/test-driver-custom-multitest.sh +++ b/t/test-driver-custom-multitest.sh @@ -106,6 +106,13 @@ END chmod a+x *.t +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + $ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/test-driver-custom-no-extra-driver.sh b/t/test-driver-custom-no-extra-driver.sh deleted file mode 100755 index 1d8553bae..000000000 --- a/t/test-driver-custom-no-extra-driver.sh +++ /dev/null @@ -1,62 +0,0 @@ -#! /bin/sh -# Copyright (C) 2011-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 auxiliary script 'test-driver' doesn't get needlessly -# installed or referenced if it's not used, i.e., if the user has -# defined his own '*LOG_DRIVER' variables. - -. ./defs || Exit 1 - -cat >> configure.ac <<'END' -AC_PROG_CC -AC_CONFIG_FILES([sub1/Makefile sub2/Makefile]) -AC_SUBST([LOG_DRIVER], ['unused but required by automake']) -AC_OUTPUT -END - -mkdir sub1 sub2 - -cat > Makefile.am <<'END' -SUBDIRS = sub1 sub2 -TEST_LOG_DRIVER = : -TESTS = foo bar.test -END - -cat > sub1/Makefile.am <<'END' -TEST_EXTENSIONS = .x .sh .pl -SH_LOG_DRIVER = dummy1 -PL_LOG_DRIVER = dummy2 -X_LOG_DRIVER = dummy3 -TESTS = a.pl b.sh c.x -END - -cat > sub2/Makefile.am <<'END' -TEST_EXTENSIONS = .bar -BAR_LOG_DRIVER = y -TESTS = 1 2.bar 3.test 4.t 5.tt $(check_PROGRAMS) -check_PROGRAMS = p1 p2$(EXEEXT) p3.bar p4.suf -END - -$ACLOCAL - -for opts in '' '--add-missing' '-a -c'; do - $AUTOMAKE $opts - $FGREP test-driver Makefile.in sub[12]/Makefile.in && Exit 1 - find . | $FGREP test-driver && Exit 1 - : For shells with busted 'set -e'. -done - -: diff --git a/t/test-driver-custom.sh b/t/test-driver-custom.sh index ce4a7fcdf..3e22f979a 100755 --- a/t/test-driver-custom.sh +++ b/t/test-driver-custom.sh @@ -115,6 +115,13 @@ cp 1.chk 4.c.chk cp 1.chk 5.suf cp 1.chk sub/test +cat > test-driver <<'END' +#!/bin/sh +echo "$0: required by Automake, but should never be actually used" >&2 +exit 1 +END +chmod a+x test-driver + $ACLOCAL $AUTOCONF $AUTOMAKE diff --git a/t/test-driver-fail.sh b/t/test-driver-fail.sh index f53e58fa8..1a4f59b96 100755 --- a/t/test-driver-fail.sh +++ b/t/test-driver-fail.sh @@ -42,7 +42,7 @@ chmod a+x foo $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure diff --git a/t/test-driver-strip-vpath.sh b/t/test-driver-strip-vpath.sh index 00acb7c42..299c4a7ff 100755 --- a/t/test-driver-strip-vpath.sh +++ b/t/test-driver-strip-vpath.sh @@ -73,7 +73,7 @@ chmod a+x checkstrip-driver $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a cd .. diff --git a/t/test-metadata-global-log.sh b/t/test-metadata-global-log.sh index 019a1e6b6..7faeb5068 100755 --- a/t/test-metadata-global-log.sh +++ b/t/test-metadata-global-log.sh @@ -23,7 +23,6 @@ . ./defs || Exit 1 cat >> configure.ac << 'END' -AC_SUBST([LOG_DRIVER], ['ignored but required by autoamke, sigh!']) AC_OUTPUT END @@ -128,7 +127,7 @@ echo TESTS = *.test >> Makefile.am $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure diff --git a/t/test-metadata-global-result.sh b/t/test-metadata-global-result.sh index 3d8759a27..cbd0cce72 100755 --- a/t/test-metadata-global-result.sh +++ b/t/test-metadata-global-result.sh @@ -69,7 +69,7 @@ have_result () $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure diff --git a/t/test-metadata-recheck.sh b/t/test-metadata-recheck.sh index 88747458c..a09c84f1f 100755 --- a/t/test-metadata-recheck.sh +++ b/t/test-metadata-recheck.sh @@ -138,7 +138,7 @@ chmod a+x dummy-driver $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE -a ./configure diff --git a/t/test-metadata-results.sh b/t/test-metadata-results.sh index ca69b9385..6fcdbb396 100755 --- a/t/test-metadata-results.sh +++ b/t/test-metadata-results.sh @@ -80,7 +80,7 @@ count_test_results () $ACLOCAL $AUTOCONF -$AUTOMAKE +$AUTOMAKE --add-missing ./configure