From: Akim Demaille Date: Mon, 20 Aug 2001 14:46:29 +0000 (+0000) Subject: * lib/autotest/general.m4 (AT_INIT): Compute top_builddir, X-Git-Tag: AUTOCONF-2.52d~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e901ead4963b9e3782981bcb22b99d30a6cf4a00;p=thirdparty%2Fautoconf.git * lib/autotest/general.m4 (AT_INIT): Compute top_builddir, top_srcdir and srcdir from at_topbuild_2_topsrc and at_testdir. Load atlocal late enough to dump it in the log. * m4/atconfig.m4 (AT_CONFIG): Pass them to atconfig. --- diff --git a/ChangeLog b/ChangeLog index 1e1c6f596..94e6822e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-08-20 Akim Demaille + + * lib/autotest/general.m4 (AT_INIT): Compute top_builddir, + top_srcdir and srcdir from at_topbuild_2_topsrc and at_testdir. + Load atlocal late enough to dump it in the log. + * m4/atconfig.m4 (AT_CONFIG): Pass them to atconfig. + 2001-08-20 Akim Demaille * tests/torture.at (Configuring subdirectories): New test. diff --git a/configure.ac b/configure.ac index 3e4f1ad90..e41b88939 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,7 @@ AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(autoconf, 2.52c) # Initialize the test suite. -AT_CONFIG(tests, ../bin) +AT_CONFIG(tests, bin) AC_PATH_PROG(EXPR, expr) # We use a path for GNU m4 so even if users have another m4 first in diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index f1a709c83..1c1d52d6e 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -94,6 +94,15 @@ AS_SHELL_SANITIZE SHELL=${CONFIG_SHELL-/bin/sh} . ./atconfig + +# Path to the top builddir: reverse at_testdir +top_builddir=`echo '$at_testdir' | + sed 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,/$,,'` +# Path to the top srcdir: to go to top build, then to top src +top_srcdir=$top_builddir/$at_topbuild_2_topsrc +# Path to srcdir: from top srcdir to this dir. +srcdir=$top_srcdir/$at_testdir + # Use absolute file notations, as the test might change directories. at_srcdir=`cd "$srcdir" && pwd` at_top_srcdir=`cd "$top_srcdir" && pwd` @@ -112,8 +121,6 @@ IFS=$at_IFS_save PATH=$at_path export PATH -test -f atlocal && . ./atlocal - # -e sets to true at_stop_on_error=false # Shall we be verbose? @@ -197,14 +204,6 @@ else at_diff=diff fi -# Tester and tested. -if $1 --version | grep "$at_package.*$at_version" >/dev/null; then - AS_BOX([Test suite for $at_package $at_version]) -else - AS_BOX([ERROR: Not using the proper version, no tests performed]) - exit 1 -fi - # Setting up the FDs. # 5 is stdout conditioned by verbosity. if test $at_verbose = echo; then @@ -218,6 +217,14 @@ if $at_debug; then exec 6>/dev/null else exec 6>$as_me.log +fi + +# Load the user config file before checking the PATH. +test -r ./atlocal && . ./atlocal + +# Tester and tested. +if $1 --version | grep "$at_package.*$at_version" >/dev/null; then + AS_BOX([Test suite for $at_package $at_version]) { AS_BOX([Test suite log for $at_package $at_version]) echo @@ -234,8 +241,19 @@ else AS_UNAME echo + # Inform about the contents of the config files. + echo "$as_me: atconfig:" >&6 + sed 's/^/| /' atconfig >&6 + if test -r ./atlocal; then + echo "$as_me: atlocal:" >&6 + sed 's/^/| /' atlocal >&6 + fi + AS_BOX([Running silently the tests]) } >&6 +else + AS_BOX([ERROR: Not using the proper version, no tests performed]) + exit 1 fi at_start_date=`date` diff --git a/m4/atconfig.m4 b/m4/atconfig.m4 index dfcb23009..2dc46d495 100644 --- a/m4/atconfig.m4 +++ b/m4/atconfig.m4 @@ -2,7 +2,7 @@ ## Prepare for testing. ## ## ----------------------## -#serial 5 +#serial 6 # Copyright 2000, 2001 Free Software Foundation, Inc. # @@ -21,14 +21,15 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. + # AT_CONFIG(TEST-DIRECTORY, [AUTOTEST-PATH = .]) # ---------------------------------------------- # Configure the test suite. # -# AUTOTEST-PATH must help the test suite to find the executables, i.e., -# if the test suite is in `tests/' and the executables are in `src/', -# pass `../src'. If there are also executables in the source tree, use -# `../src:$top_srcdir/src'. +# AUTOTEST-PATH must help the test suite to find the executables, +# i.e., if the executables are in `src/', pass `src'. If there are +# also executables in the source tree, use `src:$top_srcdir/src'. + AC_DEFUN([AT_CONFIG], [AC_CONFIG_COMMANDS([$1/atconfig], [cat >$1/atconfig <