summaryrefslogtreecommitdiff
path: root/t/aclocal-macrodirs.tap
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-11-10 10:54:44 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-11-10 13:02:12 +0100
commit838238295952cc86e5ccfe59113e6c315cf640ec (patch)
treeecce2e7693c3e04697e747644944a6c38890e035 /t/aclocal-macrodirs.tap
parent256659b06280ab4be5103c760b777e26980863c3 (diff)
downloadautomake-838238295952cc86e5ccfe59113e6c315cf640ec.tar.gz
aclocal: trace AC_CONFIG_MACRO_DIR_TRACE
This is now the documented way, and indeed the only correct way, to support AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS in third-party tools. See autoconf commit v2.69-45-g5269030 of 2012-11-09, "AC_CONFIG_MACRO_DIRS: improve tracing and add sanity checks". * aclocal.in (trace_used_macros): Trace 'AC_CONFIG_MACRO_DIR_TRACE' rather than 'AC_CONFIG_MACRO_DIRS'. We still have to trace 'AC_CONFIG_MACRO_DIR' explicitly though, for compatibility with Autoconf versions before 2.70. * t/aclocal-macrodirs.tap: Enhance w.r.t. precedence of arguments in one and several AC_CONFIG_MACRO_DIRS calls. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/aclocal-macrodirs.tap')
-rwxr-xr-xt/aclocal-macrodirs.tap45
1 files changed, 41 insertions, 4 deletions
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
index a443e50a2..28abb7ce9 100755
--- a/t/aclocal-macrodirs.tap
+++ b/t/aclocal-macrodirs.tap
@@ -26,7 +26,7 @@ am_create_testdir=empty
END
} || skip_all_ "autoconf doesn't define the AC_CONFIG_MACRO_DIRS macro"
-plan_ 13
+plan_ 14
ocwd=$(pwd) || fatal_ "getting current working directory"
ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -119,7 +119,7 @@ three_dirs_check ()
#---------------------------------------------------------------------------
-test_begin "AC_CONFIG_MACRO_DIRS: several arguments"
+test_begin "AC_CONFIG_MACRO_DIRS several arguments"
cat > configure.ac <<'END'
AC_INIT([more-args], [0.2])
@@ -135,7 +135,7 @@ test_end
#---------------------------------------------------------------------------
-test_begin "AC_CONFIG_MACRO_DIRS: several calls"
+test_begin "AC_CONFIG_MACRO_DIRS several calls"
cat > configure.ac <<'END'
AC_INIT([more-calls], [2.0])
@@ -152,7 +152,7 @@ test_end
#---------------------------------------------------------------------------
-test_begin "AC_CONFIG_MACRO_DIRS: extra whitespace"
+test_begin "AC_CONFIG_MACRO_DIRS extra whitespace"
bslash=\\
@@ -174,6 +174,43 @@ test_end
#---------------------------------------------------------------------------
+test_begin "AC_CONFIG_MACRO_DIRS precedence"
+
+cat > configure.ac <<'END'
+AC_INIT([more-calls], [2.0])
+AC_CONFIG_MACRO_DIRS([dir1])
+AC_CONFIG_MACRO_DIRS([dir2 dir3])
+MY_FOO
+MY_BAR
+MY_BAZ
+END
+
+mkdir dir1 dir2 dir3
+echo 'AC_DEFUN([MY_FOO], [OK-Foo])' > dir1/b.m4
+echo 'AC_DEFUN([MY_FOO], [KO-Foo])' > dir2/a.m4
+echo 'AC_DEFUN([MY_BAR], [OK-Bar])' > dir2/1.m4
+echo 'AC_DEFUN([MY_BAR], [KO-Bar])' > dir3/0.m4
+echo 'AC_DEFUN([MY_BAZ], [OK-Baz])' > dir3/x.m4
+
+$ACLOCAL \
+ && $FGREP 'm4_include([dir1/b.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir2/1.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([dir3/x.m4])' aclocal.m4 \
+ && test $($FGREP -c 'm4_include([dir1' aclocal.m4) -eq 1 \
+ && test $($FGREP -c 'm4_include([dir2' aclocal.m4) -eq 1 \
+ && test $($FGREP -c 'm4_include([dir3' aclocal.m4) -eq 1 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+ && $FGREP 'OK-Foo' configure \
+ && $FGREP 'OK-Bar' configure \
+ && $FGREP 'OK-Baz' configure \
+ && not $FGREP 'KO-' configure \
+ || r='not ok'
+
+test_end
+
+#---------------------------------------------------------------------------
+
test_begin "AC_CONFIG_MACRO_DIRS interaction with --install"
cat > configure.ac << 'END'