+2010-06-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Fix error in generation of parallel tests.
+ * tests/defs.in ($am_skip_defs): New variable, to be used when
+ ./defs must be sourced multiple times. If set, unset it and
+ only define $srcdir; otherwise, also go through the rest of
+ the script.
+ ($am_defs_included): Remove, no more needed.
+ * tests/Makefile.am ($(parallel_tests)): Update accordingly,
+ using only $srcdir from defs.
+ Fixes potential test failures of tests that use $required.
+
2010-06-06 Stefano Lattarini <stefano.lattarini@gmail.com>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
$(AM_V_at)rm -f $@ $@-t
$(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
{ echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+ echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+ echo; \
+ echo '# Ensure proper definition of $$srcdir.'; \
+ echo 'am_skip_defs=yes'; \
+ echo '. ./defs || exit 99'; \
+ echo 'test -n "$$srcdir" || exit 99 # sanity check'; \
+ echo; \
+ echo "# Run the test with Automake's parallel-tests driver enabled."; \
echo 'parallel_tests=yes'; \
- echo '. ./defs || Exit 1'; \
- echo '# So that the sourced test can re-exec ./defs safely.'; \
- echo 'cd "$$curdir" || Exit 1'; \
- echo ". \"\$$testsrcdir/$$input\""; \
+ echo "if test -f \"./$$input\"; then"; \
+ echo " . \"./$$input\""; \
+ echo 'else'; \
+ echo " . \"\$$srcdir/$$input\""; \
+ echo 'fi'; \
} > $@-t
$(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
$(AM_V_at)rm -f $@ $@-t
$(AM_V_GEN)input=`echo $@ | sed 's,.*/,,; s,-p.test$$,.test,'`; \
{ echo '#!/bin/sh'; \
- echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+ echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \
+ echo; \
+ echo '# Ensure proper definition of $$srcdir.'; \
+ echo 'am_skip_defs=yes'; \
+ echo '. ./defs || exit 99'; \
+ echo 'test -n "$$srcdir" || exit 99 # sanity check'; \
+ echo; \
+ echo "# Run the test with Automake's parallel-tests driver enabled."; \
echo 'parallel_tests=yes'; \
- echo '. ./defs || Exit 1'; \
- echo '# So that the sourced test can re-exec ./defs safely.'; \
- echo 'cd "$$curdir" || Exit 1'; \
- echo ". \"\$$testsrcdir/$$input\""; \
+ echo "if test -f \"./$$input\"; then"; \
+ echo " . \"./$$input\""; \
+ echo 'else'; \
+ echo " . \"\$$srcdir/$$input\""; \
+ echo 'fi'; \
} > $@-t
$(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@
# Defines for Automake testing environment.
# Tom Tromey <tromey@cygnus.com>
+# Absolutely necessary variable(s).
+srcdir=${srcdir-'@abs_srcdir@'}
+
# 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
+if test x"$am_skip_defs" = xyes; then
+ unset am_skip_defs
-else # not already included
+else # Do proper testcase setup.
# Be more Bourne compatible.
# (Snippet copied from configure's initialization in Autoconf 2.64)
exit 1
}
-srcdir=${srcdir-'@abs_srcdir@'}
-
# Ensure $srcdir is set correctly.
test -f "$srcdir/defs.in" || {
echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
pwd
-fi # not already included
+fi # Proper testcase setup.