]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Fix distcheck failure with distributed generated parallel tests.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 3 Jun 2010 12:04:06 +0000 (14:04 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 6 Jun 2010 14:38:06 +0000 (16:38 +0200)
* tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
being different from the value at developer `make dist' time.
* tests/defs.in: Protect against mutiple inclusion, by using ...
($am_defs_included): ... this new variable.
($srcdir): Do not compute, but simply define to `@abs_srcdir@'
as substituted by configure.

Report, suggestions and first fix by Ralf Wildenhues, final
patch by Stefano Lattarini.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/defs.in

index a5b5426e74a7511bb0559dcd8d0a79b53082608b..8b63a598ca5ba9a9f1e9d3c7f72fa9751a497223 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-06-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix distcheck failure with distributed generated parallel tests.
+       * tests/Makefile.am ($(parallel_tests)): Cope with $(srcdir)
+       being different from the value at developer `make dist' time.
+       * tests/defs.in: Protect against mutiple inclusion, by using ...
+       ($am_defs_included): ... this new variable.
+       ($srcdir): Do not compute, but simply define to `@abs_srcdir@'
+       as substituted by configure.
+       Report, suggestions and first fix by Ralf Wildenhues, final
+       patch by Stefano Lattarini.
+
 2010-04-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Generated tests are now just a thin layer around other tests.
index 62ad6aa2a9f25700c6db9b7969d53cab8186ff98..e647b03e99150fa1ea9adf36a57756ed89d56a53 100644 (file)
@@ -34,7 +34,10 @@ $(parallel_tests): Makefile.am
        { echo '#!/bin/sh'; \
          echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
          echo 'parallel_tests=yes'; \
-         echo ". '$(srcdir)/$$input'"; \
+         echo '. ./defs || Exit 1'; \
+         echo '# So that the sourced test can re-exec ./defs safely.'; \
+         echo 'cd "$$curdir" || Exit 1'; \
+         echo ". \"\$$testsrcdir/$$input\""; \
        } > $@-t
        $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
 
index 295d2591a439e3368321233e857d702c00bea89f..c7ab9d784e43822227f92c46694423f554e4d1bf 100644 (file)
@@ -1380,7 +1380,10 @@ $(parallel_tests): Makefile.am
        { echo '#!/bin/sh'; \
          echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
          echo 'parallel_tests=yes'; \
-         echo ". '$(srcdir)/$$input'"; \
+         echo '. ./defs || Exit 1'; \
+         echo '# So that the sourced test can re-exec ./defs safely.'; \
+         echo 'cd "$$curdir" || Exit 1'; \
+         echo ". \"\$$testsrcdir/$$input\""; \
        } > $@-t
        $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
 
index 497b57f590de09ffa10d7bc43acc0428701e8d8d..72e9d5274e6229b660e6a9825a6c0483c7f5d9ea 100644 (file)
@@ -2,7 +2,7 @@
 # @configure_input@
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009, 2010 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
 # Defines for Automake testing environment.
 # Tom Tromey <tromey@cygnus.com>
 
+# Protect this file against multiple inclusion, useful for generated tests.
+if test x"$am_defs_included" = xyes; then
+  : "$me: ./defs already included"
+  cd "$curdir/$testSubDir" || Exit 99
+
+else # not already included
+
 # Be more Bourne compatible.
 # (Snippet copied from configure's initialization in Autoconf 2.64)
 DUALCASE=1; export DUALCASE # for MKS sh
@@ -40,11 +47,7 @@ test -f ./defs || {
    exit 1
 }
 
-if test -z "$srcdir"; then
-   # compute $srcdir.
-   srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
-   test "$srcdir" = $0 && srcdir=.
-else :; fi
+srcdir=${srcdir-'@abs_srcdir@'}
 
 # Ensure $srcdir is set correctly.
 test -f "$srcdir/defs.in" || {
@@ -428,7 +431,12 @@ AUTOMAKE_fails ()
   AUTOMAKE_run 1 ${1+"$@"}
 }
 
+# Register that this file has alredy been sourced.
+am_defs_included=yes
+
 # Turn on shell traces.
 set -x
 
 pwd
+
+fi # not already included