automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, testsuite-work, updated. v1.11-1248-g59ad059
Date: Sun, 28 Aug 2011 09:52:10 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=59ad059649a33886456ddef11d66578e2b6e7dcd

The branch, testsuite-work has been updated
       via  59ad059649a33886456ddef11d66578e2b6e7dcd (commit)
      from  449a81c2fd090be94d6128aba1dfbcfd9e15e4ae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 59ad059649a33886456ddef11d66578e2b6e7dcd
Author: Stefano Lattarini <address@hidden>
Date:   Sun Aug 28 11:48:44 2011 +0200

    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.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   14 ++++++++++
 tests/Makefile.am                                  |   16 +++++++++++
 tests/Makefile.in                                  |   24 ++++++++++++++---
 ...lel-tests-once.test => test-logs-repeated.test} |   27 +++++++++-----------
 4 files changed, 62 insertions(+), 19 deletions(-)
 copy tests/{parallel-tests-once.test => test-logs-repeated.test} (63%)
 mode change 100755 => 100644

diff --git a/ChangeLog b/ChangeLog
index af6d0d4..8e4e6d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-08-28  Stefano Lattarini  <address@hidden>
+
+       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  <address@hidden>
 
        tests: fix spurious failure for awk implementation of TAP driver
diff --git a/tests/Makefile.am b/tests/Makefile.am
index aee5978..95d9efa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -770,6 +770,7 @@ test-driver-trs-suffix-registered.test \
 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 \
@@ -1247,6 +1248,21 @@ tap-summary-color.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)
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 8cf3bc4..0a63b7b 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1013,6 +1013,7 @@ test-driver-trs-suffix-registered.test \
 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 \
@@ -1754,7 +1755,7 @@ distdir: $(DISTFILES)
          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:
@@ -1863,9 +1864,9 @@ uninstall-am:
        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 \
@@ -1951,6 +1952,21 @@ $(tap_with_common_setup_logs): tap-common-setup.log 
tap-setup.sh
 
 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 \
diff --git a/tests/parallel-tests-once.test b/tests/test-logs-repeated.test
old mode 100755
new mode 100644
similarity index 63%
copy from tests/parallel-tests-once.test
copy to tests/test-logs-repeated.test
index d676a12..94dd7c8
--- a/tests/parallel-tests-once.test
+++ b/tests/test-logs-repeated.test
@@ -14,35 +14,32 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Tests shouldn't be run multiple times by a simple "make check" in a
-# clean directory.  An early implementation of the `.trs' intermediate
-# files incurred a similar problem.
+# 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'
+cat >> configure.in <<END
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-TESTS = foo.test
+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
 
-cat > foo.test <<'END'
-#! /bin/sh
-test -f foo.run && Exit 1
-: > foo.run
-END
-chmod a+x foo.test
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
 ./configure
-
-$MAKE check
-test -f foo.run # Sanity check.
+$MAKE verify
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]