autoconf-patches
[Top][All Lists]
Advanced

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

04-deep-autoreconf.patch


From: Akim Demaille
Subject: 04-deep-autoreconf.patch
Date: Tue, 29 Oct 2002 09:10:42 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/torture.at (Deep Package): New test.
        (Configuring subdirectories): Don't use a testSubDir as Autotest
        now does it itself.

Index: tests/torture.at
--- tests/torture.at Sun, 13 Oct 2002 10:08:25 +0200 akim
+++ tests/torture.at Tue, 29 Oct 2002 09:06:36 +0100 akim
@@ -561,18 +561,6 @@ m4_define([AT_DUMMY_VAR],
 # We use aclocal (via autoreconf).
 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])

-# Move into a fresh testSubDir.  But Autotest is not ready for such
-# tricks, albeit most useful :( It expects to find its files
-# (at-setup-line and so on) in the original `.', and it will complain
-# not to find even one.  So just run mkdir as if it were a test.  This
-# will create at-setup-line blah blah, and Autotest will leave us in
-# peace.
-#
-# FIXME: The more I think about it, the more I am tempted to *always*
-# have test groups run in a subdir, a` la Automake.
-AT_CHECK([AS_MKDIR_P([testSubDir])])
-cd testSubDir
-
 # The contents of `inner/', and `inner/innermost/'.
 AS_MKDIR_P([inner/innermost])

@@ -580,7 +568,7 @@ m4_define([AT_DUMMY_VAR],
 # be compatible with Automake 1.4: aclocal (run by autoreconf) would
 # die because it can't find configure.in.
 AT_DATA([inner/configure.in],
-[AC_INIT(GNU Inner, 1.0)
+[[AC_INIT(GNU Inner, 1.0)
 AC_CONFIG_SRCDIR([innermost/config.in])
 AC_ARG_VAR([INNER], [an inner variable])
 AC_SUBST([INNER])
@@ -589,7 +577,7 @@ m4_define([AT_DUMMY_VAR],
 fi
 AC_CONFIG_FILES([innermost/config])
 AC_OUTPUT
-])
+]])

 AT_DATA([inner/innermost/config.in],
 address@hidden@
@@ -603,14 +591,14 @@ m4_define([AT_DUMMY_VAR],

 # nonexistent is allowed not to exist.
 AT_DATA([configure.in],
-[AC_INIT(GNU Outer, 1.0)
+[[AC_INIT(GNU Outer, 1.0)
 AC_ARG_VAR([OUTER], [an outer variable])
 if false; then
   AC_CONFIG_SUBDIRS([nonexistent])
 fi
 AC_CONFIG_SUBDIRS([inner])
 AC_OUTPUT
-])
+]])

 AT_CHECK([autoreconf])
 AT_CHECK([test -f inner/configure])
@@ -650,5 +638,69 @@ m4_define([AT_DUMMY_VAR],
 top_srcdir=../../../inner
 prefix=/good
 ])
+
+AT_CLEANUP
+
+
+
+## -------------- ##
+## Deep Package.  ##
+## -------------- ##
+
+AT_SETUP([Deep Package])
+AT_KEYWORDS(autoreconf)
+
+# We use aclocal (via autoreconf).
+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
+
+# The contents of `.'
+AT_DATA([install-sh], [])
+AT_DATA([configure.in],
+[[AC_INIT(GNU Outer, 1.0)
+AC_ARG_VAR([OUTER], [an outer variable])
+AC_CONFIG_SUBDIRS([inner])
+AC_OUTPUT
+]])
+
+# The contents of `inner/', and `inner/innermost/'.
+AS_MKDIR_P([inner/innermost])
+
+AT_DATA([inner/configure.ac],
+[[AC_INIT(GNU Inner, 1.0)
+AC_ARG_VAR([INNER], [an inner variable])
+AC_CONFIG_SUBDIRS(innermost)
+AC_OUTPUT
+]])
+
+AT_DATA([inner/innermost/configure.ac],
+[[AC_INIT(GNU Innermost, 1.0)
+AC_ARG_VAR([INNERMOST], [an innermost variable])
+AC_CONFIG_HEADERS(config.h:config.hin)
+AC_DEFINE_UNQUOTED([INNERMOST], [$INNERMOST], [an innermost variable])
+AC_OUTPUT
+]])
+
+AT_CHECK([autoreconf -Wall -v], [0], [ignore], [ignore])
+AT_CHECK([test -f inner/configure])
+AT_CHECK([test -f inner/innermost/configure])
+AT_CHECK([test -f inner/innermost/config.hin])
+
+# Running the outer configure recursively should provide the innermost
+# help strings.
+AT_CHECK([./configure --help=recursive | grep -w INNER],     0, [ignore])
+AT_CHECK([./configure --help=recursive | grep -w INNERMOST], 0, [ignore])
+
+# Running the outer configure should trigger the inner.
+AT_CHECK_CONFIGURE([INNERMOST=tsomrenni])
+AT_CHECK([grep INNERMOST inner/innermost/config.h], 0,
+[[#define INNERMOST tsomrenni
+]])
+
+# The same, but from a builddir.
+AS_MKDIR_P([builddir])
+AT_CHECK([cd builddir && ../configure INNERMOST=build/tsomrenni], 0, [ignore])
+AT_CHECK([grep INNERMOST builddir/inner/innermost/config.h], 0,
+[[#define INNERMOST build/tsomrenni
+]])

 AT_CLEANUP




reply via email to

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