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 <akim@epita.fr>
+
+ * 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 <akim@epita.fr>
* tests/torture.at (Configuring subdirectories): New test.
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
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`
PATH=$at_path
export PATH
-test -f atlocal && . ./atlocal
-
# -e sets to true
at_stop_on_error=false
# Shall we be verbose?
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
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
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`
## Prepare for testing. ##
## ----------------------##
-#serial 5
+#serial 6
# Copyright 2000, 2001 Free Software Foundation, Inc.
#
# 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 <<EOF
at_n='$at_n'
at_c='$at_c'
-srcdir='$srcdir'
-top_srcdir='$top_srcdir'
+at_testdir='$1'
+at_topbuild_2_topsrc='$at_topbuild_2_topsrc'
+
AUTOTEST_PATH='m4_default([$2], [.])'
SHELL=\${CONFIG_SHELL-'$at_shell'}
at_n='$ECHO_N'
at_c='$ECHO_C'
-srcdir='$srcdir'
-top_srcdir=`echo '$1/' | sed 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,/$,,'`
+# Path from top_build to top_src
+at_topbuild_2_topsrc=$srcdir
at_shell='$SHELL'
at_path_separator='$PATH_SEPARATOR'