autoconf-patches
[Top][All Lists]
Advanced

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

Forbidden strings not detected


From: Pavel Roskin
Subject: Forbidden strings not detected
Date: Thu, 14 Dec 2000 17:16:29 -0500 (EST)

Hello!

The CVS version of Autoconf doesn't detect forbidden strings, such as
AC_FOO, unless m4_pattern_allow is used.

It's amazing that the existing testsuite could not catch it because the
test does include m4_pattern_allow.

Sometimes simple basic tests are useful too.

ChangeLog:
        autoconf.sh: If the "allowed" pattern is not defined set it
        to "^$"
        tests/tools.at (autoconf: forbidden tokens, basic): New test.
        (autoconf: forbidden tokens): Renamed to ...
        (autoconf: forbidden tokens, exceptions): ... this.

Regards,
Pavel Roskin

_______________________________
--- tests/tools.at
+++ tests/tools.at
@@ -190,7 +190,39 @@
 ## autoconf: forbidden tokens.  ##
 ## ---------------------------- ##

-AT_SETUP([autoconf: forbidden tokens])
+# autoconf: forbidden tokens, basic
+# ---------------------------------
+AT_SETUP([autoconf: forbidden tokens, basic])
+
+AT_DATA([configure.in],
+[[AC_PLAIN_SCRIPT()dnl
+AC_FOO
+_AC_BAR
+m4_foo
+_m4_bar
+BAC_FOO
+B_AC_FOO
+AS_FOO
+_AS_BAR
+]])
+
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir 2>err], 1)
+# The output of autoconf is not deterministic here because it
+# uses `for (ind in array)'.  So be sure to have a unique representation.
+AT_CHECK([sort <err], 0,
+[[configure.in:2: error: undefined macro: AC_FOO
+configure.in:3: error: undefined macro: _AC_BAR
+configure.in:4: error: undefined macro: m4_foo
+configure.in:7: error: undefined macro: B_AC_FOO
+configure.in:8: error: undefined macro: AS_FOO
+]])
+
+AT_CLEANUP(configure err)
+
+
+# autoconf: forbidden tokens, exceptions
+# --------------------------------------
+AT_SETUP([autoconf: forbidden tokens, exceptions])

 AT_DATA([configure.in],
 [[AC_PLAIN_SCRIPT()dnl
--- autoconf.sh
+++ autoconf.sh
@@ -327,6 +327,8 @@

       while ((getline pattern < (tmp "/allowed.rx")) > 0)
         allowed = (allowed ? allowed "|" : "") pattern
+      if (!allowed)
+        allowed = "^$"
       close (tmp "/allowed.rx")
       if (verbose)
         errprint("$me: allowed: " allowed)
_______________________________





reply via email to

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