bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with $srcdir and friends in autotest


From: Noah Misch
Subject: Re: problem with $srcdir and friends in autotest
Date: Wed, 13 Jun 2007 18:40:55 -0700
User-agent: Mutt/1.5.9i

On Tue, Jun 12, 2007 at 10:41:44PM -0400, Mike Frysinger wrote:
> AT_SETUP([lot])
> AT_CHECK([
> "$builddir/lot" "$srcdir/lot.input" > lot.out
> bzcmp "$srcdir/lot.out.bz2" lot.out
> ], [0])
> AT_CLEANUP
> 
> the tests/ subdir looks like:
> tests/lot.c (lot is compiled)
> tests/lot.input
> tests/lot.out.bz2
> 
> building in tree works ok, but building out of tree yields:
> srcdir="../../tests/../.."
> 
> using $top_srcdir/tests/lot.input works though both in and out of tree ...

Thanks; the test suite was computing $srcdir incorrectly.  I installed this fix:

2007-06-13  Noah Misch  <address@hidden>

        * lib/autotest/general.m4 (AT_INIT): Compute $srcdir correctly.
        * tests/autotest.at (srcdir propagation): New test.
        * THANKS: Update.
        Reported by Mike Frysinger.

diff -Nurp -X dontdiff ac-clean/lib/autotest/general.m4 
ac-atsrcdir/lib/autotest/general.m4
--- ac-clean/lib/autotest/general.m4    2007-06-13 13:36:58.000000000 -0400
+++ ac-atsrcdir/lib/autotest/general.m4 2007-06-13 20:29:44.000000000 -0400
@@ -220,7 +220,7 @@ if test -n "$at_top_srcdir"; then
   for at_dir in srcdir top_srcdir top_build_prefix
   do
     at_val=AS_VAR_GET([at_$at_dir])
-    AS_VAR_SET([$at_dir], [$at_val/../..])
+    AS_VAR_SET([$at_dir], [../../$at_val])
   done
 fi
 
diff -Nurp -X dontdiff ac-clean/tests/autotest.at ac-atsrcdir/tests/autotest.at
--- ac-clean/tests/autotest.at  2007-05-05 00:39:14.000000000 -0400
+++ ac-atsrcdir/tests/autotest.at       2007-06-13 20:41:30.000000000 -0400
@@ -415,3 +415,64 @@ AT_CHECK_KEYS([-3], [none|first|second],
 AT_CHECK_KEYS([4-], [both], [1], [none|first|second], [0])
 AT_CHECK_KEYS([-k second 4-], [second|both], [2], [none|first], [0])
 AT_CLEANUP
+
+
+## ------------------- ##
+## srcdir propagation. ##
+## ------------------- ##
+
+AT_SETUP([srcdir propagation])
+AT_KEYWORDS([autotest])
+AT_CAPTURE_FILE([suite.log])
+
+mkdir pkg vpath-outside
+mkdir pkg/t pkg/vpath-inside
+AT_DATA([pkg/a])
+AT_DATA([pkg/t/b])
+
+AT_DATA([pkg/configure.ac], [[AC_INIT
+AC_CONFIG_AUX_DIR($top_srcdir/build-aux)
+AC_CONFIG_TESTDIR([t])
+AC_OUTPUT
+]])
+cd pkg
+AT_CHECK_AUTOCONF
+cd ..
+
+AT_DATA([pkg/t/suite.at],
+[[m4_define([AT_PACKAGE_NAME],    [GNU Nonsense])
+m4_define([AT_PACKAGE_TARNAME],   [nonsense])
+m4_define([AT_PACKAGE_VERSION],   [1.0])
+m4_define([AT_PACKAGE_STRING],    [GNU Nonsense 1.0])
+m4_define([AT_PACKAGE_BUGREPORT], address@hidden)
+AT_INIT([suite to check srcdir])
+AT_SETUP([my only test])
+AT_CHECK([test -f "$top_srcdir"/a && test -f "$srcdir"/b])
+AT_CLEANUP
+]])
+cd pkg/t
+AT_CHECK_AUTOM4TE([--language=autotest -o suite suite.at])
+cd ../..
+
+# Build directory totally outside source directory.
+cd vpath-outside
+AT_CHECK([top_srcdir=$abs_top_srcdir ../pkg/configure], [0], [ignore])
+cd t
+AT_CHECK([../../pkg/t/suite], [0], [ignore])
+cd ../..
+
+# Build directory as subdirectory of source directory.
+cd pkg/vpath-inside
+AT_CHECK([top_srcdir=$abs_top_srcdir ../configure], [0], [ignore])
+cd t
+AT_CHECK([../../t/suite], [0], [ignore])
+cd ../../..
+
+# Build directory as source directory.
+cd pkg
+AT_CHECK_CONFIGURE
+cd t
+AT_CHECK([./suite], [0], [ignore])
+cd ../..
+
+AT_CLEANUP




reply via email to

[Prev in Thread] Current Thread [Next in Thread]