]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: unconditionally distribute test-driver
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 May 2012 23:48:52 +0000 (01:48 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 20:46:18 +0000 (22:46 +0200)
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 <stefano.lattarini@gmail.com>
19 files changed:
automake.in
t/tap-bad-prog.tap
t/tap-basic.sh
t/tap-common-setup.sh
t/tap-diagnostic-custom.sh
t/tap-more.sh
t/tap-more2.sh
t/tap-recheck.sh
t/test-driver-acsubst.sh
t/test-driver-create-log-dir.sh
t/test-driver-custom-multitest.sh
t/test-driver-custom-no-extra-driver.sh [deleted file]
t/test-driver-custom.sh
t/test-driver-fail.sh
t/test-driver-strip-vpath.sh
t/test-metadata-global-log.sh
t/test-metadata-global-result.sh
t/test-metadata-recheck.sh
t/test-metadata-results.sh

index db0fe586bab312722b9c9d08246d57a561285ca3..5138cf54a2daf549de4b6a6964379fae785ccd28 100644 (file)
@@ -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.
index 260932914bdbe1d85511258bab8358f360579259..ff7794abde9bff65c3c0cb8a230c78ba2c7bfaa4 100755 (executable)
@@ -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
index 60a3c7f87d5f6f544994149d71ea92727423a9c2..09901c7706b1dca690a3e9be9e6fb4009076b492 100755 (executable)
@@ -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
index b4026d5c19b331fa3ecf7e895ec1855a539abb1d..f76ce3b08fea7446213ca02dbe3b7aea45edfb66 100755 (executable)
 
 . ./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
 
index d1a4f98d57c3736e000a3b0007a9e4f5253d8f3a..afe0c00835c3a88f5022aa55fb25768ee600a10d 100755 (executable)
@@ -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
 
index 5949e15a7af671305c36c378d59223d9b4145f92..014f347cce5e3dbaabfbe6576ac469c340218a90 100755 (executable)
@@ -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
index b34e3c18d46e5618454ac9d3e518e676ee8d8ff1..9ac5c116489a1cb7fb943a5ca61c5b2ce9201855 100755 (executable)
@@ -77,7 +77,7 @@ END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
 
 ./configure
 
index 2416c6a6e11b07e41e648bbaf592861e8e99f20d..e689c2c54993bb9b14d5386cb4f89692cd2b535f 100755 (executable)
@@ -81,7 +81,7 @@ chmod a+x *.test
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 do_recheck ()
 {
index e384ac79224b6c9d19e0039078710e3dacf5fcd9..06c9a114b6832c0e8cf881bf49e6e5a2b85d2456 100755 (executable)
@@ -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'])
index dc8e6811fc26f3fbe9fc84ab17f6ec98ff04ee1d..b74809343fe7d621fe77db82f1addac010993b0c 100755 (executable)
@@ -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
index 19acd98607b8cb722c84cae37341fccc7ce58643..291c95f22e574dbceee10fbdf35dc1388a285468 100755 (executable)
@@ -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 (executable)
index 1d8553b..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-
-# 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
-
-:
index ce4a7fcdf24faec37d150a73ff5d786230b9cfdc..3e22f979a68adc1a0880fb370c45f69e6b6bc90c 100755 (executable)
@@ -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
index f53e58fa844c6e1e85df8e57d2ced6afeec0751d..1a4f59b9646e9b26d91b1e4266806e924a7db4c1 100755 (executable)
@@ -42,7 +42,7 @@ chmod a+x foo
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 ./configure
 
index 00acb7c42e6430c22e97c306bbcfa8747cf06409..299c4a7ff14104fe0bb1fb7058fa1ffd26bb921e 100755 (executable)
@@ -73,7 +73,7 @@ chmod a+x checkstrip-driver
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 cd ..
 
index 019a1e6b613a9a832f34d9a74beeb640b39db3bb..7faeb5068d0f4c82831fc6020e0a24df11696bdb 100755 (executable)
@@ -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
 
index 3d8759a2716ffc8e006d9eea5087ad5f77ea49bd..cbd0cce72266a6e6a7f816c36b4e1c3f2feff8a0 100755 (executable)
@@ -69,7 +69,7 @@ have_result ()
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 ./configure
 
index 88747458cced1e6844a0f1e53e110d7bfa220608..a09c84f1f23201db773f9c5a0135d0758973c439 100755 (executable)
@@ -138,7 +138,7 @@ chmod a+x dummy-driver
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE -a
 
 ./configure
 
index ca69b93850c86e44694a38dc76dc237253bf5369..6fcdbb396128f019abe46433af9292fa8271017e 100755 (executable)
@@ -80,7 +80,7 @@ count_test_results ()
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE
+$AUTOMAKE --add-missing
 
 ./configure