+2011-08-28 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: different test scripts cannot share the same basename
+ If two test scripts have the same basename, they will end up
+ sharing the same log file, leading to all sort of undefined and
+ undesired behaviours. Add a Makefile check verifying that this
+ is not the case.
+ * tests/test-logs-repeated.test: New test, verifying previously
+ unspecified semantics (in the definition of $(TEST_LOGS) from
+ $(TESTS)) that we use in our new check.
+ * tests/Makefile.am (TESTS): Update.
+ (check-no-repeated-test-name): New .PHONY check.
+ (check-local): Depend on it.
+
2011-08-26 Stefano Lattarini <stefano.lattarini@gmail.com>
tests: fix spurious failure for awk implementation of TAP driver
test-driver-fail.test \
test-harness-vpath-rewrite.test \
test-log.test \
+test-logs-repeated.test \
test-metadata-global-log.test \
test-metadata-global-result.test \
test-metadata-recheck.test \
tap-summary.log tap-summary-color.log: tap-summary-aux.sh
EXTRA_DIST += tap-summary-aux.sh
+# If two test scripts have the same basename, they will end up sharing
+# the same log file, leading to all sort of undefined and undesired
+# behaviours.
+check-no-repeated-test-name:
+ @LC_ALL=C; export LC_ALL; \
+ lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
+ | sort | uniq -c | awk '($$1 > 1) { print }' \
+ | sed 's/\.log$$//' | grep . >&2 \
+ && { \
+ echo $@: test names listed above are duplicated >&2; \
+ exit 1; \
+ }; :
+check-local: check-no-repeated-test-name
+.PHONY: check-no-repeated-test-name
+
## Checking the list of tests.
checked_test_extensions = .test .tap
expected_list_of_tests = $(handwritten_tests)
test-driver-fail.test \
test-harness-vpath-rewrite.test \
test-log.test \
+test-logs-repeated.test \
test-metadata-global-log.test \
test-metadata-global-result.test \
test-metadata-recheck.test \
fi; \
done
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
check: check-am
all-am: Makefile
installdirs:
recheck-html
.PHONY: all all-am am--redo-logs check check-TESTS check-am check-html \
- clean clean-generic clean-local distclean distclean-generic \
- distdir dvi dvi-am html html-am info info-am install \
- install-am install-data install-data-am install-dvi \
+ check-local clean clean-generic clean-local distclean \
+ distclean-generic distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
tap-summary.log tap-summary-color.log: tap-summary-aux.sh
+# If two test scripts have the same basename, they will end up sharing
+# the same log file, leading to all sort of undefined and undesired
+# behaviours.
+check-no-repeated-test-name:
+ @LC_ALL=C; export LC_ALL; \
+ lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
+ | sort | uniq -c | awk '($$1 > 1) { print }' \
+ | sed 's/\.log$$//' | grep . >&2 \
+ && { \
+ echo $@: test names listed above are duplicated >&2; \
+ exit 1; \
+ }; :
+check-local: check-no-repeated-test-name
+.PHONY: check-no-repeated-test-name
+
.PHONY: maintainer-check-list-of-tests
maintainer-check-list-of-tests:
@if diff -u /dev/null /dev/null >/dev/null 2>&1; then \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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 parallel-tests features:
+# - $(TESTS_LOGS) can end up holding duplicated entries
+# Such behaviour can be useful for projects that want to verify that
+# different test scripts don't end up sharing the same log file.
+# (Automake itself is such a project, BTW ;-)
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+cat >> configure.in <<END
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TEST_EXTENSIONS = .sh .test .bar
+TESTS = foo.sh mu.test foo.test foo.bar
+.PHONY: verify
+verify:
+ test "`echo $(TEST_LOGS)`" = 'foo.log mu.log foo.log foo.log'
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE verify
+
+: