[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH 09/17] [ng] check: unconditionally distribute test-
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH 09/17] [ng] check: unconditionally distribute test-driver |
Date: |
Tue, 22 May 2012 22:48:47 +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 <address@hidden>
---
automake.in | 2 +-
t/tap-bad-prog.tap | 15 ++++----
t/tap-basic.sh | 9 ++++-
t/tap-common-setup.sh | 17 ++++-----
t/tap-diagnostic-custom.sh | 3 +-
t/tap-more.sh | 7 ++++
t/tap-more2.sh | 2 +-
t/tap-recheck.sh | 2 +-
t/test-driver-acsubst.sh | 7 ++++
t/test-driver-create-log-dir.sh | 7 ++++
t/test-driver-custom-multitest.sh | 7 ++++
t/test-driver-custom-no-extra-driver.sh | 62 -------------------------------
t/test-driver-custom.sh | 7 ++++
t/test-driver-fail.sh | 2 +-
t/test-driver-strip-vpath.sh | 2 +-
t/test-metadata-global-log.sh | 3 +-
t/test-metadata-global-result.sh | 2 +-
t/test-metadata-recheck.sh | 2 +-
t/test-metadata-results.sh | 2 +-
19 files changed, 67 insertions(+), 93 deletions(-)
delete mode 100755 t/test-driver-custom-no-extra-driver.sh
diff --git a/automake.in b/automake.in
index db0fe58..5138cf5 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 2609329..ff7794a 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 60a3c7f..09901c7 100755
--- a/t/tap-basic.sh
+++ b/t/tap-basic.sh
@@ -46,8 +46,6 @@ ok.test:
echo 'ok 3 # SKIP' >>address@hidden
cat address@hidden ;: For debugging.
mv -f address@hidden $@
-
-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 b4026d5..f76ce3b 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 d1a4f98..afe0c00 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 5949e15..014f347 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 b34e3c1..9ac5c11 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 2416c6a..e689c2c 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 e384ac7..06c9a11 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 dc8e681..b748093 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 19acd98..291c95f 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 1d8553b..0000000
--- 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 <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
-
-:
diff --git a/t/test-driver-custom.sh b/t/test-driver-custom.sh
index ce4a7fc..3e22f97 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 f53e58f..1a4f59b 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 00acb7c..299c4a7 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 019a1e6..7faeb50 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 3d8759a..cbd0cce 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 8874745..a09c84f 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 ca69b93..6fcdbb3 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
--
1.7.9.5
- [Automake-NG] [PATCH 00/17] Move almost parallel-tests processing at make runtime, Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 01/17] [ng] am: new private make variable $(am__all_progs), Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 02/17] [ng] serial-tests: simplify automake-time preprocessing, Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 03/17] [ng] tests: get rid of an almost-obsolete test case (parallel-tests related), Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 04/17] [ng] am: implement $(am__tolower) and $(am__toupper), Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 05/17] [ng] refactor: make '$am_config_aux_dir' available as a make variable, Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 06/17] [ng] check: move definition of console colors in its own '.am' fragment, Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 07/17] [ng] check: separate serial an parallel harnesses in distinct '.am' files, Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 08/17] [ng] check: warn about invalid TEST_EXTENSIONS at make runtime, Stefano Lattarini, 2012/05/22
- [Automake-NG] [PATCH 09/17] [ng] check: unconditionally distribute test-driver,
Stefano Lattarini <=
[Automake-NG] [PATCH 10/17] [ng] am: new make variable '$(am__handle_exxext)', Stefano Lattarini, 2012/05/22