+2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: avoid extra test generation (for `instspc' tests)
+ We don't really need to generate tons and tons of wrapper test
+ scripts (presently, ~ 90) just to run what is basically a single
+ test (specifically, `instspc-tests.sh') with different parameters.
+ In fact, the possibility of running a single driver script with
+ multiple files/configurations/parameters is one of the major
+ selling points of the 'parallel-tests' testsuite driver of
+ automake. So why not use ourselves more extensively the best
+ features we provide?
+ * tests/instspc-tests.sh: Update heading comments. Expect
+ to be executed, not sourced. Update handling of command-line
+ arguments. Adjust to reflect the renaming of "instspc tests"
+ from `instspc-*.test' to `*.instspc'.
+ * tests/instspc-data.test: Update heading comments. Execute
+ driver script `instspc-tests.sh', instead of sourcing it.
+ Give more informative messages in case of internal errors.
+ * tests/Makefile.am (TESTS_EXTENSIONS): Define explicitly (to
+ `.test' and `.instspc').
+ (TESTS): Add `$(instspc_tests)'.
+ (generated_tests): Remove `$(instspc_tests)'.
+ (INSTSPC_LOG_COMPILER): Define. Calls `instspc-tests.sh', so
+ that the "instspc tests" will be now executed by passing that
+ driver script a proper parameter.
+ ($(instspc_tests)): Remove, we don't need anymore to generate
+ this tests.
+ ($(instspc_tests:.test=.log)): Remove, substituted by ...
+ ($(instspc_tests:.instspc=.log)): ... this.
+ ($(instspc_tests)): New dependency declaration (dummy, but
+ required in order to have make actually produce expected log
+ files from the `.instspc.log' suffix rule).
+ (MAINTAINERCLEANFILES, generated_tests): Don't extend with
+ $(instspc_tests) anymore.
+ Update comments.
+
2011-05-01 Stefano Lattarini <stefano.lattarini@gmail.com>
build: improve the definition of the list of testcases
MAINTAINERCLEANFILES =
EXTRA_DIST = ChangeLog-old
+TEST_EXTENSIONS = .test .instspc
XFAIL_TESTS = \
all.test \
include $(srcdir)/instspc-tests.am
+INSTSPC_LOG_COMPILER = $(SHELL) $(srcdir)/instspc-tests.sh
+
$(srcdir)/instspc-tests.am: instspc-tests.sh Makefile.am
$(AM_V_GEN)($(am__cd) $(srcdir) \
&& $(SHELL) ./instspc-tests.sh --generate-makefile) >$@
-$(instspc_tests): Makefile.am
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN) :; \
- base=`expr 'x/$@' : 'x.*/instspc-\(.*\)\.test$$'`; \
- name=`expr x"$$base" : x'\(.*\)-'`; \
- action=`expr x"$$base" : x'.*-\(.*\)'`; \
- { \
- echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
- echo; \
- echo '# Ensure proper definition of $$testsrcdir.'; \
- echo '. ./defs-static || exit 99'; \
- echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
- echo; \
- echo "instspc_test_name='$$name'"; \
- echo "instspc_action='test-$$action'"; \
- echo ". \$$testsrcdir/instspc-tests.sh"; \
- } > $@-t
- $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
-
-# All instspc-*.test tests work by sourcing the `instspc-tests.sh'
-# script. Also, they all use shared data generated by the helper
-# test `instspc-data.test', for reasons of speed.
+# All `*.instspc' tests work by calling the script `instspc-tests.sh'.
+# Also, they all use shared data generated by the `instspc-data.test'
+# helper test (for reasons of speed).
instspc-data.log: instspc-tests.sh
-$(instspc_tests:.test=.log): instspc-tests.sh instspc-data.log
+$(instspc_tests:.instspc=.log): instspc-tests.sh instspc-data.log
+# This dummy declaration is required to have make actually produce
+# expected log files from the `.instspc.log' suffix rule.
+$(instspc_tests):
-MAINTAINERCLEANFILES += $(instspc_tests)
EXTRA_DIST += instspc-tests.sh
XFAIL_TESTS += $(instspc_xfail_tests)
test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
exec 9>&2; stderr_fileno_=9; export stderr_fileno_;
-TESTS = $(handwritten_tests) $(generated_tests)
+TESTS = \
+ $(handwritten_tests) \
+ $(generated_tests) \
+ $(instspc_tests)
EXTRA_DIST += $(handwritten_tests) $(generated_tests)
-generated_tests = $(parallel_tests) $(instspc_tests)
+generated_tests = $(parallel_tests)
handwritten_tests = \
aclocal.test \
AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
TEST_SUITE_LOG = test-suite.log
TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
-TEST_EXTENSIONS = .test
am__test_logs1 = $(TESTS:=.log)
-TEST_LOGS = $(am__test_logs1:.test.log=.log)
+am__test_logs2 = $(am__test_logs1:.test.log=.log)
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
+TEST_LOGS = $(am__test_logs2:.instspc.log=.log)
+INSTSPC_LOG_COMPILE = $(INSTSPC_LOG_COMPILER) $(AM_INSTSPC_LOG_FLAGS) \
+ $(INSTSPC_LOG_FLAGS)
TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
+MAINTAINERCLEANFILES = $(parallel_tests)
EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
$(handwritten_tests) $(generated_tests)
+TEST_EXTENSIONS = .test .instspc
XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
override-conditional-2.test pr8365-remake-timing.test \
yacc-dist-nobuild-subdir.test txinfo5.test \
exeext4-p.test maken3-p.test maken4-p.test \
posixsubst-tests-p.test pr401-p.test pr401b-p.test \
pr401c-p.test
-instspc_tests = instspc-squote-build.test instspc-squote-install.test \
- instspc-dquote-build.test instspc-dquote-install.test \
- instspc-bquote-build.test instspc-bquote-install.test \
- instspc-sharp-build.test instspc-sharp-install.test \
- instspc-dollar-build.test instspc-dollar-install.test \
- instspc-bang-build.test instspc-bang-install.test \
- instspc-bslash-build.test instspc-bslash-install.test \
- instspc-ampersand-build.test instspc-ampersand-install.test \
- instspc-percent-build.test instspc-percent-install.test \
- instspc-leftpar-build.test instspc-leftpar-install.test \
- instspc-rightpar-build.test instspc-rightpar-install.test \
- instspc-pipe-build.test instspc-pipe-install.test \
- instspc-caret-build.test instspc-caret-install.test \
- instspc-tilde-build.test instspc-tilde-install.test \
- instspc-qmark-build.test instspc-qmark-install.test \
- instspc-star-build.test instspc-star-install.test \
- instspc-plus-build.test instspc-plus-install.test \
- instspc-minus-build.test instspc-minus-install.test \
- instspc-comma-build.test instspc-comma-install.test \
- instspc-colon-build.test instspc-colon-install.test \
- instspc-semicol-build.test instspc-semicol-install.test \
- instspc-equal-build.test instspc-equal-install.test \
- instspc-less-build.test instspc-less-install.test \
- instspc-more-build.test instspc-more-install.test \
- instspc-at-build.test instspc-at-install.test \
- instspc-lqbrack-build.test instspc-lqbrack-install.test \
- instspc-rqbrack-build.test instspc-rqbrack-install.test \
- instspc-lcbrack-build.test instspc-lcbrack-install.test \
- instspc-rcbrack-build.test instspc-rcbrack-install.test \
- instspc-space-build.test instspc-space-install.test \
- instspc-tab-build.test instspc-tab-install.test \
- instspc-linefeed-build.test instspc-linefeed-install.test \
- instspc-backspace-build.test instspc-backspace-install.test \
- instspc-formfeed-build.test instspc-formfeed-install.test \
- instspc-carriageret-build.test \
- instspc-carriageret-install.test \
- instspc-quadrigraph0-build.test \
- instspc-quadrigraph0-install.test \
- instspc-quadrigraph1-build.test \
- instspc-quadrigraph1-install.test \
- instspc-quadrigraph2-build.test \
- instspc-quadrigraph2-install.test \
- instspc-quadrigraph3-build.test \
- instspc-quadrigraph3-install.test \
- instspc-quadrigraph4-build.test \
- instspc-quadrigraph4-install.test instspc-a_b-build.test \
- instspc-a_b-install.test instspc-a__b-build.test \
- instspc-a__b-install.test instspc-a_lf_b-build.test \
- instspc-a_lf_b-install.test instspc-dotdotdot-build.test \
- instspc-dotdotdot-install.test instspc-dosdrive-build.test \
- instspc-dosdrive-install.test instspc-miscglob1-build.test \
- instspc-miscglob1-install.test instspc-miscglob2-build.test \
- instspc-miscglob2-install.test
-instspc_xfail_tests = instspc-squote-build.test \
- instspc-dquote-build.test instspc-bquote-build.test \
- instspc-sharp-build.test instspc-dollar-build.test \
- instspc-bslash-build.test instspc-ampersand-build.test \
- instspc-linefeed-build.test instspc-quadrigraph0-build.test \
- instspc-a_lf_b-build.test instspc-squote-install.test \
- instspc-dquote-install.test instspc-bquote-install.test \
- instspc-sharp-install.test instspc-dollar-install.test \
- instspc-linefeed-install.test instspc-a_lf_b-install.test
+instspc_tests = build-squote.instspc install-squote.instspc \
+ build-dquote.instspc install-dquote.instspc \
+ build-bquote.instspc install-bquote.instspc \
+ build-sharp.instspc install-sharp.instspc build-dollar.instspc \
+ install-dollar.instspc build-bang.instspc install-bang.instspc \
+ build-bslash.instspc install-bslash.instspc \
+ build-ampersand.instspc install-ampersand.instspc \
+ build-percent.instspc install-percent.instspc \
+ build-leftpar.instspc install-leftpar.instspc \
+ build-rightpar.instspc install-rightpar.instspc \
+ build-pipe.instspc install-pipe.instspc build-caret.instspc \
+ install-caret.instspc build-tilde.instspc \
+ install-tilde.instspc build-qmark.instspc \
+ install-qmark.instspc build-star.instspc install-star.instspc \
+ build-plus.instspc install-plus.instspc build-minus.instspc \
+ install-minus.instspc build-comma.instspc \
+ install-comma.instspc build-colon.instspc \
+ install-colon.instspc build-semicol.instspc \
+ install-semicol.instspc build-equal.instspc \
+ install-equal.instspc build-less.instspc install-less.instspc \
+ build-more.instspc install-more.instspc build-at.instspc \
+ install-at.instspc build-lqbrack.instspc \
+ install-lqbrack.instspc build-rqbrack.instspc \
+ install-rqbrack.instspc build-lcbrack.instspc \
+ install-lcbrack.instspc build-rcbrack.instspc \
+ install-rcbrack.instspc build-space.instspc \
+ install-space.instspc build-tab.instspc install-tab.instspc \
+ build-linefeed.instspc install-linefeed.instspc \
+ build-backspace.instspc install-backspace.instspc \
+ build-formfeed.instspc install-formfeed.instspc \
+ build-carriageret.instspc install-carriageret.instspc \
+ build-quadrigraph0.instspc install-quadrigraph0.instspc \
+ build-quadrigraph1.instspc install-quadrigraph1.instspc \
+ build-quadrigraph2.instspc install-quadrigraph2.instspc \
+ build-quadrigraph3.instspc install-quadrigraph3.instspc \
+ build-quadrigraph4.instspc install-quadrigraph4.instspc \
+ build-a_b.instspc install-a_b.instspc build-a__b.instspc \
+ install-a__b.instspc build-a_lf_b.instspc \
+ install-a_lf_b.instspc build-dotdotdot.instspc \
+ install-dotdotdot.instspc build-dosdrive.instspc \
+ install-dosdrive.instspc build-miscglob1.instspc \
+ install-miscglob1.instspc build-miscglob2.instspc \
+ install-miscglob2.instspc
+instspc_xfail_tests = build-squote.instspc build-dquote.instspc \
+ build-bquote.instspc build-sharp.instspc build-dollar.instspc \
+ build-bslash.instspc build-ampersand.instspc \
+ build-linefeed.instspc build-quadrigraph0.instspc \
+ build-a_lf_b.instspc install-squote.instspc \
+ install-dquote.instspc install-bquote.instspc \
+ install-sharp.instspc install-dollar.instspc \
+ install-linefeed.instspc install-a_lf_b.instspc
+INSTSPC_LOG_COMPILER = $(SHELL) $(srcdir)/instspc-tests.sh
# Some testsuite-influential variables should be overridable from the
# test scripts, but not from the environment.
test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
exec 9>&2; stderr_fileno_=9; export stderr_fileno_;
-TESTS = $(handwritten_tests) $(generated_tests)
-generated_tests = $(parallel_tests) $(instspc_tests)
+TESTS = \
+ $(handwritten_tests) \
+ $(generated_tests) \
+ $(instspc_tests)
+
+generated_tests = $(parallel_tests)
handwritten_tests = \
aclocal.test \
aclocal3.test \
all: all-am
.SUFFIXES:
-.SUFFIXES: .html .log .test
+.SUFFIXES: .html .instspc .log .test
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/parallel-tests.am $(srcdir)/instspc-tests.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
$(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
.test.log:
@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
+.instspc.log:
+ @p='$<'; $(am__check_pre) $(INSTSPC_LOG_COMPILE) "$$tst" $(am__check_post)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
$(AM_V_GEN)($(am__cd) $(srcdir) \
&& $(SHELL) ./instspc-tests.sh --generate-makefile) >$@
-$(instspc_tests): Makefile.am
- $(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN) :; \
- base=`expr 'x/$@' : 'x.*/instspc-\(.*\)\.test$$'`; \
- name=`expr x"$$base" : x'\(.*\)-'`; \
- action=`expr x"$$base" : x'.*-\(.*\)'`; \
- { \
- echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
- echo; \
- echo '# Ensure proper definition of $$testsrcdir.'; \
- echo '. ./defs-static || exit 99'; \
- echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \
- echo; \
- echo "instspc_test_name='$$name'"; \
- echo "instspc_action='test-$$action'"; \
- echo ". \$$testsrcdir/instspc-tests.sh"; \
- } > $@-t
- $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
-
-# All instspc-*.test tests work by sourcing the `instspc-tests.sh'
-# script. Also, they all use shared data generated by the helper
-# test `instspc-data.test', for reasons of speed.
+# All `*.instspc' tests work by calling the script `instspc-tests.sh'.
+# Also, they all use shared data generated by the `instspc-data.test'
+# helper test (for reasons of speed).
instspc-data.log: instspc-tests.sh
-$(instspc_tests:.test=.log): instspc-tests.sh instspc-data.log
+$(instspc_tests:.instspc=.log): instspc-tests.sh instspc-data.log
+# This dummy declaration is required to have make actually produce
+# expected log files from the `.instspc.log' suffix rule.
+$(instspc_tests):
# Each test case depends on defs, aclocal, and automake.
$(TEST_LOGS): defs aclocal-$(APIVERSION) automake-$(APIVERSION)
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Driver script to generate and run tests checking that building from,
-# or installing to, directories with shell metacharacters succeed.
+# Driver script to run tests checking that building from, or installing
+# to, directories with shell metacharacters succeed.
#
# Original report from James Amundson about file names with spaces.
# Other characters added by Paul Eggert.
#
# This script fulfills a threefold role:
-# 1. It generates a Makefile.am snippet, containing the definition
-# of proper lists of tests.
-# 2. It sets up a directory containing some common data files and
-# autotools-generated files used by said generated tests (this
-# is done for speed reasons only).
-# 3. It is sourced by said generated tests with proper parameters
-# pre-set, to run the "meat" of the checks.
-# This setup might seem a tricky and over-engineered abuse, but past
-# (painful) experiences showed that it is indeed required, because
-# the test generation code and test execution code tend to be
-# inextricably coupled and intertwined.
+# 1. It is called to generate a Makefile.am snippet, containing the
+# definition of proper lists of tests.
+# 2. It is called to set up a directory containing some common data
+# files and autotools-generated files used by the aforementioned
+# tests (this is done for speed reasons only).
+# 3. It is called to properly run those tests, one at a time.
#
# Be more Bourne compatible (snippet copied from `tests/defs').
set -e
-# Sanity and usage checks.
-if test x"$instspc_action" = x; then
- if test "$#,$1" = "1,--generate-makefile"; then
- instspc_action=generate-makefile
- else
- echo "$0: empty action and no proper command line" >&2
- exit 99
- fi
-elif test $# -gt 0; then
- echo "$0: action specified and command line arguments used" >&2
- exit 99
-fi
+case $# in
+ 0) echo "$0: missing argument" >&2; exit 99;;
+ 1) ;;
+ *) echo "$0: too many arguments" >&2; exit 99;;
+esac
-case $instspc_action in
- generate-makefile|generate-data)
+case $1 in
+ --generate-makefile|--generate-data)
+ instspc_action=`expr x"$1" : x'--\(.*\)'`
;;
- test-build|test-install)
- if test x"$instspc_test_name" = x; then
- echo "$0: test name undefined for action '$instspc_action'" >&2
- exit 99
- fi
+ build-*.instspc|*/build-*.instspc)
+ instspc_action=test-build
+ instspc_test_name=`expr /"$1" : '.*/build-\(.*\)\.instspc'`
+ ;;
+ install-*.instspc|*/install-*.instspc)
+ instspc_action=test-install
+ instspc_test_name=`expr /"$1" : '.*/install-\(.*\)\.instspc'`
;;
*)
- echo "$0: invalid action: '$instspc_action'"
+ echo "$0: invalid argument '$1'" >&2
exit 99
;;
esac
echo 'instspc_tests ='
echo 'instspc_xfail_tests ='
for test_name in $instspc_names_list; do
- echo "instspc_tests += instspc-$test_name-build.test"
- echo "instspc_tests += instspc-$test_name-install.test"
+ echo "instspc_tests += build-$test_name.instspc"
+ echo "instspc_tests += install-$test_name.instspc"
done
for test_name in $instspc_xfail_builds_list; do
- echo "instspc_xfail_tests += instspc-$test_name-build.test"
+ echo "instspc_xfail_tests += build-$test_name.instspc"
done
for test_name in $instspc_xfail_installs_list; do
- echo "instspc_xfail_tests += instspc-$test_name-install.test"
+ echo "instspc_xfail_tests += install-$test_name.instspc"
done
exit 0
fi
# We'll need the full setup provided by `tests/defs'. Temporarily disable
# the errexit flag, since the setup code might not be prepared to deal
-# with it.
+# with it. Also pre-set `$me' for `tests/defs', so that different calls
+# to `instspc-tests.sh' won't try to use the same temporary directory.
+if test x"$instspc_action" = x"generate-data"; then
+ me=instspc-data
+else
+ me=$instspc_action-$instspc_test_name
+fi
set +e
. ./defs || Exit 99
set -e