[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCHv2 5/8] coverage: expose a bug in aclocal (spurious warnings)
From: |
Stefano Lattarini |
Subject: |
[PATCHv2 5/8] coverage: expose a bug in aclocal (spurious warnings) |
Date: |
Sat, 10 Nov 2012 14:55:54 +0100 |
When some macro expanded in configure.ac calls AC_REQUIRE on another
macro that is defined in one of the local m4 macro dirs specified
with one of the macros AC_CONFIG_MACRO_DIRS or AC_CONFIG_MACRO_DIR,
aclocal prints spurious warnings like:
configure.ac:4: warning: MY_BAR is m4_require'd but not m4_defun'd
configure.ac:3: MY_FOO is expanded from...
Expose this weakness in our testsuite.
Reported by Nick Bowler; see point (4) of:
<http://lists.gnu.org/archive/html/autoconf-patches/2012-11/msg00000.html>
* t/aclocal-macrodir.tap ("AC_CONFIG_MACRO_DIR interaction with
AC_REQUIRE"): New test, still xfailing.
* t/aclocal-macrodirs.tap ("AC_CONFIG_MACRO_DIRS interaction with
AC_REQUIRE"): Likewise.
Signed-off-by: Stefano Lattarini <address@hidden>
---
t/aclocal-macrodir.tap | 27 ++++++++++++++++++++++++++-
t/aclocal-macrodirs.tap | 33 ++++++++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 2 deletions(-)
diff --git a/t/aclocal-macrodir.tap b/t/aclocal-macrodir.tap
index 4114edb..c48b31f 100755
--- a/t/aclocal-macrodir.tap
+++ b/t/aclocal-macrodir.tap
@@ -20,7 +20,7 @@
am_create_testdir=empty
. test-init.sh
-plan_ 5
+plan_ 6
ocwd=$(pwd) || fatal_ "getting current working directory"
ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -173,4 +173,29 @@ test_end
#---------------------------------------------------------------------------
+test_begin "AC_CONFIG_MACRO_DIR interaction with AC_REQUIRE" TODO
+
+cat > configure.ac <<'END'
+AC_INIT([req], [1.0])
+AC_CONFIG_MACRO_DIR([macro-dir])
+AC_DEFUN([MY_FOO], [AC_REQUIRE([MY_BAR])])
+MY_FOO
+END
+
+mkdir macro-dir
+echo 'AC_DEFUN([MY_BAR], [//my//bar//])' > macro-dir/x.m4
+
+st=0; $ACLOCAL 2>stderr || st=$?
+cat stderr >&2
+
+test $st -eq 0 \
+ && test ! -s stderr \
+ && $FGREP 'm4_include([macro-dir/x.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR)' configure \
+ && $FGREP '//my//bar//' configure \
+ || r='not ok'
+
+test_end
+
:
diff --git a/t/aclocal-macrodirs.tap b/t/aclocal-macrodirs.tap
index 81ca75e..3007ed4 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_ 12
+plan_ 13
ocwd=$(pwd) || fatal_ "getting current working directory"
ACLOCAL_PATH=; unset ACLOCAL_PATH
@@ -341,4 +341,35 @@ test_end
#---------------------------------------------------------------------------
+test_begin "AC_CONFIG_MACRO_DIRS interaction with AC_REQUIRE" TODO
+
+cat > configure.ac <<'END'
+AC_INIT([req], [1.0])
+AC_CONFIG_MACRO_DIRS([m1 m2])
+AC_DEFUN([MY_FOO], [
+ AC_REQUIRE([MY_BAR])
+ AC_REQUIRE([MY_BAZ])
+])
+MY_FOO
+END
+
+mkdir m1 m2
+echo 'AC_DEFUN([MY_BAR], [^^my^^bar^^])' > m1/x.m4
+echo 'AC_DEFUN([MY_BAZ], [~~my~~baz~~])' > m2/x.m4
+
+st=0; $ACLOCAL 2>stderr || st=$?
+cat stderr >&2
+
+test $st -eq 0 \
+ && test ! -s stderr \
+ && $FGREP 'm4_include([m1/x.m4])' aclocal.m4 \
+ && $FGREP 'm4_include([m2/x.m4])' aclocal.m4 \
+ && $AUTOCONF \
+ && not $EGREP 'MY_(FOO|BAR|BAZ)' configure \
+ && $FGREP '^^my^^bar^^' configure \
+ && $FGREP '~~my~~baz~~' configure \
+ || r='not ok'
+
+test_end
+
:
--
1.8.0
- [PATCH 6/6] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS, (continued)
[PATCHv2 0/8] Support for AC_CONFIG_MACRO_DIRS in Automake, Stefano Lattarini, 2012/11/10
- [PATCHv2 1/8] aclocal: multiple local m4 macro dirs with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10
- [PATCHv2 2/8] aclocal: diagnose non-existing directories in AC_CONFIG_MACRO_DIRS better, Stefano Lattarini, 2012/11/10
- [PATCHv2 3/8] tests: better coverage for AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10
- [PATCHv2 4/8] aclocal: smash newlines in arguments of traced macros, Stefano Lattarini, 2012/11/10
- [PATCHv2 5/8] coverage: expose a bug in aclocal (spurious warnings),
Stefano Lattarini <=
- [PATCHv2 6/8] aclocal: avoid spurious warnings from autom4te with AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10
- [PATCHv2 7/8] aclocal: trace AC_CONFIG_MACRO_DIR_TRACE, Stefano Lattarini, 2012/11/10
- [PATCHv2 8/8] news: we trace AC_CONFIG_MACRO_DIRS, Stefano Lattarini, 2012/11/10
- Re: [PATCHv2 0/8] Support for AC_CONFIG_MACRO_DIRS in Automake, Stefano Lattarini, 2012/11/10