]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autotest/general.m4 (AT_INIT): Compute top_builddir,
authorAkim Demaille <akim@epita.fr>
Mon, 20 Aug 2001 14:46:29 +0000 (14:46 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 20 Aug 2001 14:46:29 +0000 (14:46 +0000)
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.

ChangeLog
configure.ac
lib/autotest/general.m4
m4/atconfig.m4

index 1e1c6f596bf14b40a958dde8c0da75b524cf16ef..94e6822e1aff68a3d75eb98128d288dbc5c56949 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
index 3e4f1ad900ceac595ec011a958a0a406d18539aa..e41b88939f6805d7bd0d7166db09d0cf19925169 100644 (file)
@@ -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
index f1a709c830d5dc77f686c7865a94936167577238..1c1d52d6e0597377bd32d3c81cc467bd85785707 100644 (file)
@@ -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`
index dfcb23009fd14e0fade1f485753077b088077869..2dc46d495fe976c7f72501c30a7d5c4eea69d922 100644 (file)
@@ -2,7 +2,7 @@
 ## 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
@@ -43,8 +44,9 @@ at_bugreport='$at_bugreport'
 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'}
@@ -59,8 +61,8 @@ at_bugreport='$PACKAGE_BUGREPORT'
 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'