# 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])
# 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])
fi
AC_CONFIG_FILES([innermost/config])
AC_OUTPUT
-])
+]])
AT_DATA([inner/innermost/config.in],
[INNER=@INNER@
# 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])
])
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