From b30c520ee85b91dd8a5afa5296b83e0ec578c53e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 2 Jun 2010 21:55:23 +0200 Subject: [PATCH] Tests defs: $srcdir renaming. * tests/defs.in ($srcdir): Remove, define $testsrcdir directly. * tests/Makefile.am ($(parallel_tests)): Generation of derived tests updated. --- ChangeLog | 5 +++++ tests/Makefile.am | 6 +++--- tests/Makefile.in | 6 +++--- tests/defs.in | 18 ++++++++---------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28826f388..2b41e2bd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-09-06 Stefano Lattarini + Tests defs: $srcdir and $top_srcdir renaming. + * tests/defs.in ($srcdir): Remove, define $testsrcdir directly. + * tests/Makefile.am ($(parallel_tests)): Generation of derived + tests updated. + Tests defs: new variable $top_testsrcdir. * tests/defs.in ($top_testsrcdir): Define unconditionally to @abs_top_srcdir@. Use it throughout. diff --git a/tests/Makefile.am b/tests/Makefile.am index d86b03b35..f4fba45ed 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,10 +34,10 @@ $(parallel_tests): Makefile.am { echo '#!/bin/sh'; \ echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ echo; \ - echo '# Ensure proper definition of $$srcdir.'; \ + echo '# Ensure proper definition of $$testsrcdir.'; \ echo 'am_skip_defs=yes'; \ echo '. ./defs || exit 99'; \ - echo 'test -n "$$srcdir" || exit 99 # sanity check'; \ + echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \ echo; \ echo "# Run the test with Automake's parallel-tests driver enabled."; \ echo 'parallel_tests=yes'; \ @@ -46,7 +46,7 @@ $(parallel_tests): Makefile.am echo "if test -f \"./$$input\"; then"; \ echo " . \"./$$input\""; \ echo 'else'; \ - echo " . \"\$$srcdir/$$input\""; \ + echo " . \"\$$testsrcdir/$$input\""; \ echo 'fi'; \ } > $@-t $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@ diff --git a/tests/Makefile.in b/tests/Makefile.in index 77ec8886e..af80fdbe6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1408,10 +1408,10 @@ $(parallel_tests): Makefile.am { echo '#!/bin/sh'; \ echo '# DO NOT EDIT! GENERATED AUTOMATICALLY!'; \ echo; \ - echo '# Ensure proper definition of $$srcdir.'; \ + echo '# Ensure proper definition of $$testsrcdir.'; \ echo 'am_skip_defs=yes'; \ echo '. ./defs || exit 99'; \ - echo 'test -n "$$srcdir" || exit 99 # sanity check'; \ + echo 'test -n "$$testsrcdir" || exit 99 # sanity check'; \ echo; \ echo "# Run the test with Automake's parallel-tests driver enabled."; \ echo 'parallel_tests=yes'; \ @@ -1420,7 +1420,7 @@ $(parallel_tests): Makefile.am echo "if test -f \"./$$input\"; then"; \ echo " . \"./$$input\""; \ echo 'else'; \ - echo " . \"\$$srcdir/$$input\""; \ + echo " . \"\$$testsrcdir/$$input\""; \ echo 'fi'; \ } > $@-t $(AM_V_at)chmod a+rx $@-t && mv -f $@-t $@ diff --git a/tests/defs.in b/tests/defs.in index 71796599e..7f6807c97 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -21,7 +21,7 @@ # Tom Tromey # Absolutely necessary variable(s). -srcdir='@abs_srcdir@' +testsrcdir='@abs_srcdir@' top_testsrcdir='@abs_top_srcdir@' # Protect this file against multiple inclusion, useful for generated tests. @@ -50,9 +50,9 @@ test -f ./defs || { exit 1 } -# Ensure $srcdir is set correctly. -test -f "$srcdir/defs.in" || { - echo "$srcdir/defs.in not found, check \$srcdir" 1>&2 +# Ensure $testsrcdir is set correctly. +test -f "$testsrcdir/defs.in" || { + echo "$testsrcdir/defs.in not found, check \$testsrcdir" 1>&2 exit 1 } @@ -312,6 +312,9 @@ unset DESTDIR unset prefix exec_prefix bindir datarootdir datadir docdir dvidir unset htmldir includedir infodir libdir libexecdir localedir mandir unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir +# The tests call `make -e' but we do not want $srcdir from the environment +# to override the definition from the Makefile. +unset srcdir # Also unset variables that control our test driver. While not # conceptually independent, they cause some changed semantics we # need to control (and test for) in some of the tests to ensure @@ -361,7 +364,7 @@ case " $required " in # Libtool cannot cope with spaces in the build tree. Our testsuite setup # cannot cope with spaces in the source tree name for Libtool and gettext # tests. - case $srcdir,`pwd` in + case $testsrcdir,`pwd` in *\ * | *\ *) Exit 77;; esac ACLOCAL="$ACLOCAL -Wno-syntax -I $top_testsrcdir/m4 $extra_includes -I $aclocaldir" @@ -380,11 +383,6 @@ FGREP='@FGREP@' # and can be up to 3 seconds in the future w.r.t. the system clock. sleep='sleep @MODIFICATION_DELAY@' -# The tests call `make -e' but we do not want $srcdir from the environment -# to override the definition from the Makefile. -testsrcdir=$srcdir -unset srcdir - # An old timestamp that can be given to a file, in "touch -t" format. # The time stamp should be portable to all file systems of interest. # Just for fun, choose the exact time of the announcement of the GNU project -- 2.47.2