]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autom4te.in (handle_m4): Pass --fatal-warning to m4, so that
authorAkim Demaille <akim@epita.fr>
Fri, 18 Oct 2002 15:20:46 +0000 (15:20 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 18 Oct 2002 15:20:46 +0000 (15:20 +0000)
missing included files _are_ errors.
Thanks to Alexandre Duret-Lutz.
* tests/tools.at (autom4te cache): Adjust.
* tests/atspecific.m4 (AT_CHECK_AUTOM4TE): New.
(AT_CHECK_M4SUGAR): Use it.
* tests/m4sugar.at (m4_warn, m4_require: circular dependencies):
Adjust.
* tests/tools.at (autom4te): Now it does exit 1.

ChangeLog
bin/autom4te.in
tests/atspecific.m4
tests/m4sugar.at
tests/tools.at

index 6007a8733bd929672635e4008a6e7e770a1b802d..58c60ce6a44c89b25ab6a8c2345b88270523995d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2002-10-18  Akim Demaille  <akim@epita.fr>
+
+       * bin/autom4te.in (handle_m4): Pass --fatal-warning to m4, so that
+       missing included files _are_ errors.
+       Thanks to Alexandre Duret-Lutz.
+       * tests/tools.at (autom4te cache): Adjust.
+       * tests/atspecific.m4 (AT_CHECK_AUTOM4TE): New.
+       (AT_CHECK_M4SUGAR): Use it.
+       * tests/m4sugar.at (m4_warn, m4_require: circular dependencies):
+       Adjust.
+       * tests/tools.at (autom4te): Now it does exit 1.
+
 2002-10-17  Akim Demaille  <akim@epita.fr>
 
        * lib/autoconf/general.m4 (AC_CACHE_SAVE): Don't use cmp.
index 7a50ac6fc4eac13bd6770a25d0907599ee6c3417..77f94a0ef7aeb49edb5beb12fb3ed8582634eb5b 100644 (file)
@@ -632,6 +632,7 @@ sub handle_m4 ($@)
           . join (' --include=', '', @include)
           . " --define=m4_warnings=$m4_warnings"
           . ' --debug=aflq'
+          . (!exists $ENV{'AUTOM4TE_NO_FATAL'} ? ' --fatal-warning' : '')
           . " --error-output=$tcache" . $req->id . "t"
           . join (' --trace=',   '', sort @macro)
           . " " . files_to_options (@ARGV)
index be5bd2d972d52574bd8c182f9a5566003b75cf48..1b928f4f497bf9ae18c8d6ad32040a03b5f2072a 100644 (file)
 # 02111-1307, USA.
 
 
+## ------------------ ##
+## Testing autom4te.  ##
+## ------------------ ##
+
+
+# AT_CHECK_AUTOM4TE(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
+# -----------------------------------------------------------
+# If stderr is specified, normalize the observed stderr.  E.g.:
+#
+#  /usr/local/bin/m4: script.4s: 1: Cannot open foo: No such file or directory
+#  autom4te: /usr/local/bin/m4 failed with exit status: 1
+#
+# becomes
+#
+#  m4: script.4s: 1: Cannot open foo: No such file or directory
+#  autom4te: m4 failed with exit status: 1
+
+m4_define([AT_CHECK_AUTOM4TE],
+[AT_CHECK([autom4te $1], [$2], [$3], m4_ifval([$4], [stderr]))
+m4_ifval([$4],
+[AT_CHECK([[sed 's,[^ ]*/m4,m4,' stderr]], [0],[$4])])
+])
+
+
+
 ## ----------------- ##
 ## Testing M4sugar.  ##
 ## ----------------- ##
@@ -37,7 +62,7 @@ m4_define([AT_DATA_M4SUGAR],
 # AT_CHECK_M4SUGAR(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
 # ----------------------------------------------------------
 m4_define([AT_CHECK_M4SUGAR],
-[AT_CHECK([autom4te --language=m4sugar script.4s -o script $1],
+[AT_CHECK_AUTOM4TE([--language=m4sugar script.4s -o script $1],
           m4_default([$2], [0]), [$3], [$4])])
 
 
index cc2b25b9b6ad64dfe49ce0d13309eececc2fd356..40322974f390703461636f8d68b2f2d046445e5a 100644 (file)
@@ -61,9 +61,7 @@ AT_CHECK_M4SUGAR([-o- -Wnone,bar -f], 0, [],
 [script.4s:2: warning: bar
 ])
 
-AT_CHECK_M4SUGAR([-o- -Wnone,bar,error -f], 1, [], [stderr])
-# The error message contains the path to m4, which might change.
-AT_CHECK([sed 's/^autom4te.*failed/autom4te: m4 failed/' stderr], 0,
+AT_CHECK_M4SUGAR([-o- -Wnone,bar,error -f], 1, [],
 [[script.4s:2: error: bar
 script.4s:2: the top level
 autom4te: m4 failed with exit status: 1
@@ -96,9 +94,8 @@ m4_init
 baz
 ]])
 
-# Expected stderr.
-AT_DATA_M4SUGAR([expout],
-[[script.4s:11: error: m4_require: circular dependency of foo
+AT_CHECK_M4SUGAR([], 1, [],
+[[script.4s:11: error: m4@&t@_require: circular dependency of foo
 script.4s:11: foo is required by...
 script.4s:5: bar is expanded from...
 script.4s:11: bar is required by...
@@ -108,10 +105,6 @@ script.4s:8: baz is expanded from...
 script.4s:11: the top level
 autom4te: m4 failed with exit status: 1
 ]])
-
-AT_CHECK_M4SUGAR([], 1, [], stderr)
-# The error message contains the path to m4, which might change.
-AT_CHECK([sed 's/^autom4te.*failed/autom4te: m4 failed/' stderr], 0, [expout])
 AT_CLEANUP
 
 
index 087aca66b08f4c6e978d8513925f2af85c9e08cf..bd89dd08a71caa1f7ea93f48699f0bbb3a2dfb0d 100644 (file)
@@ -128,9 +128,9 @@ AT_CHECK_M4SUGAR
 # We moved a file: it should fail
 mkdir sub
 mv foo sub
-AT_CHECK_M4SUGAR([], [], [], [stderr])
-AT_CHECK([[sed 's/^[^:]*m4:/m4:/' stderr]], [],
+AT_CHECK_M4SUGAR([], [1], [],
 [m4: script.4s: 1: Cannot open foo: No such file or directory
+autom4te: m4 failed with exit status: 1
 ])
 
 # But if we change the main file, then we should no longer complain of