automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, experimental/parallel-tests


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, experimental/parallel-tests-pattern-rules, updated. v1.11b-128-g8f8a2ab
Date: Sun, 22 Apr 2012 17:04:45 +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=8f8a2ab28e12e90d3f538f66f04a2f951ee8729a

The branch, experimental/parallel-tests-pattern-rules has been updated
       via  8f8a2ab28e12e90d3f538f66f04a2f951ee8729a (commit)
      from  dd2fd4b1f06192ceec29e9ad653c615d23c19e77 (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 8f8a2ab28e12e90d3f538f66f04a2f951ee8729a
Author: Stefano Lattarini <address@hidden>
Date:   Sun Apr 22 16:37:11 2012 +0200

    parallel-tests: support lel-tests and dynamic $(TESTS) content
    
    This change fixes a small but annoying limitation of the parallel
    testsuite harness.   Before this change, if $(TESTS) contained a test
    case with '$(srcdir)' in its name:
    
      TESTS = $(srcdir)/foo.test
    
    the parallel testsuite driver would have created the 'foo.log' and
    'foo.trs' files in the source directory rather than in the build
    directory.  This made it impossible to employ useful constructs
    of the kind:
    
      TESTS = $(wildcard *.test)
    
    in a VPATH setup; in fact, the idiom as written above would have missed
    any test in the source directory (i.e., any non-generated tests), while
    the "corrected" idiom:
    
      TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh t[0-9][0-9]*.sh)
    
    would have created the '.log' and '.trs' files for any distributed test
    in the source directory.
    
    After this change, the "corrected" idiom above is usable.
    
    * lib/am/check.am (am__cooked_tests): New variable, containing all the
    entries of $(TESTS) with $(srcdir) prefix (if present) removed.
    * am__cooked_tests: Likewise, but for the contents of $(XFAIL_TESTS).
    * automake.in (handle_tests): Adjust the definition of $(TEST_LOGS) to
    use '$(am__cooked_tests)' instead of raw '$(TESTS)'.
    * t/parallel-tests-srcdir-in-test-name.sh: Adjust to test the new
    semantics.
    * t/list-of-tests.mk (XFAIL_TESTS): Remove the above test, it now
    passes.
    * t/parallel-tests-dynamic.sh: Enhance a little.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

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

Summary of changes:
 automake.in                             |    2 +-
 lib/am/check.am                         |   11 ++++++-
 t/list-of-tests.mk                      |    1 -
 t/parallel-tests-dynamic.sh             |    9 ++---
 t/parallel-tests-srcdir-in-test-name.sh |   53 ++++++++++++++++++++++++++++--
 5 files changed, 64 insertions(+), 12 deletions(-)

diff --git a/automake.in b/automake.in
index 6b9cb94..bb019d4 100644
--- a/automake.in
+++ b/automake.in
@@ -4812,7 +4812,7 @@ sub handle_tests
          push @test_suffixes, '';
 
           define_variable ('am__test_logs1',
-                           '$(patsubst %,%.log,$(strip $(TESTS)))',
+                           '$(patsubst %,%.log,$(strip $(am__cooked_tests)))',
                            INTERNAL);
          my $nhelper = 1;
          foreach my $test_suffix (@test_suffixes)
diff --git a/lib/am/check.am b/lib/am/check.am
index 59c5829..546f60c 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -53,6 +53,15 @@ if %?PARALLEL_TESTS%
 ## of more test metadata, and the use of custom test derivers and protocols
 ## (among them, TAP).
 
+# Required to support explicit use of $(srcdir) in TESTS entries.
+# That might actually be very useful in practice, for example in usages
+# like this:
+#   TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh)
+# Removing the '$(srcdir)' in there would cause the idiom to break in
+# VPATH builds.
+am__cooked_tests = $(patsubst $(srcdir)/%,%,$(strip $(TESTS)))
+am__cooked_xfail_tests = $(patsubst $(srcdir)/%,%,$(strip $(XFAIL_TESTS)))
+
 # Restructured Text title and section.
 am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
 am__rst_section = { sed 'p;s/./=/g;' && echo; }
@@ -92,7 +101,7 @@ if test -n '$(DISABLE_HARD_ERRORS)'; then            \
 else                                                   \
   am__enable_hard_errors=yes;                          \
 fi;                                                    \
-case " $(strip $(XFAIL_TESTS)) " in                    \
+case " $(am__cooked_xfail_tests) " in                  \
   *" $$f "*) am__expect_failure=yes;;                  \
           *) am__expect_failure=no;;                   \
 esac;                                                  \
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index e3febf1..d2b88a3 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -40,7 +40,6 @@ t/instdir-cond2.sh \
 t/interp3.sh \
 t/java-nobase.sh \
 t/objext-pr10128.sh \
-t/parallel-tests-srcdir-in-test-name.sh \
 t/parallel-tests-many.sh \
 t/pr8365-remake-timing.sh \
 t/remake-am-pr10111.sh \
diff --git a/t/parallel-tests-dynamic.sh b/t/parallel-tests-dynamic.sh
index 8ae0fe2..c0d93b2 100755
--- a/t/parallel-tests-dynamic.sh
+++ b/t/parallel-tests-dynamic.sh
@@ -72,9 +72,10 @@ cat > Makefile.am << 'END'
 my_add_dirprefix = $(strip $(1))/$(strip $(2))
 EXTRA_DIST = $(TESTS) get-tests-list
 TEST_EXTENSIONS = .sh
-TESTS = $(wildcard t[0-9][0-9]*.sh) $(shell $(srcdir)/get-tests-list)
+TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh)
+TESTS += $(shell $(srcdir)/get-tests-list)
 TESTS += $(call my_add_dirprefix, t, nosuffix)
-XFAIL_TESTS = $(wildcard t9[0-9]*.sh)
+XFAIL_TESTS = $(wildcard $(srcdir)/t9[0-9]*.sh)
 END
 
 $ACLOCAL
@@ -105,9 +106,7 @@ test "`find . -name *.log`" = ./config.log
 
 $MAKE distcheck > stdout || { cat stdout; Exit 1; }
 cat stdout
-# FIXME: this is currently broken, as the $(wildcard ...) call miss the
-# FIXME: $(srcdir) component ...
-#count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0
+count_test_results total=11 pass=9 fail=0 xpass=0 xfail=2 skip=0 error=0
 
 $MAKE check tests1='$(wildcard t00*.sh t98?.sh)' \
             tests2='$(shell ./get-tests-list | sed 1d)' \
diff --git a/t/parallel-tests-srcdir-in-test-name.sh 
b/t/parallel-tests-srcdir-in-test-name.sh
index 01042a5..4c834d9 100755
--- a/t/parallel-tests-srcdir-in-test-name.sh
+++ b/t/parallel-tests-srcdir-in-test-name.sh
@@ -29,13 +29,58 @@ am_parallel_tests=yes
 echo AC_OUTPUT >> configure.ac
 
 cat > Makefile.am << 'END'
-TESTS = $(srcdir)/bar.test $(top_srcdir)/baz.test
+TESTS = \
+  $(srcdir)/foo \
+  @srcdir@/foo2 \
+  @srcdir@/bar.test \
+  ${srcdir}/sub/baz.test \
+  built.test
+
+XFAIL_TESTS = $(srcdir)/bar.test foo2
+
+built.test:
+       (echo '#!/bin/sh' && echo 'exit 77') >address@hidden
+       chmod a-w,a+x address@hidden && mv -f address@hidden $@
+END
+
+cat > foo <<'END'
+#!/bin/sh
+exit 0
+END
+chmod a+x foo
+
+cat > foo2 <<'END'
+#!/bin/sh
+exit 1
 END
+chmod a+x foo2
+
+cp foo2 bar.test
+
+mkdir sub
+cp foo sub/baz.test
 
 $ACLOCAL
 $AUTOCONF
-AUTOMAKE_fails -a
-grep '$(srcdir).*TESTS.*bar\.test' stderr
-grep '$(top_srcdir).*TESTS.*baz\.test' stderr
+$AUTOMAKE -a
+
+mkdir build
+cd build
+../configure
+$MAKE check
+
+ls -l . .. # For debugging.
+
+test -f built.log
+test -f foo.log
+test -f bar.log
+test -f sub/baz.log
+test -f test-suite.log
+
+test ! -f ../built.log
+test ! -f ../foo.log
+test ! -f ../bar.log
+test ! -f ../sub/baz.log
+test ! -f ../test-suite.log
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

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