[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
m4 --fatal-warning
From: |
Akim Demaille |
Subject: |
m4 --fatal-warning |
Date: |
18 Oct 2002 17:21:13 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
I'm applying this: thanks to Alexandre for pointing out to me that
--fatal-warning was what I was looking for. Actually, autom4te
already passed it to m4 where freezing...
Index: ChangeLog
from Akim Demaille <address@hidden>
* 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.
Index: bin/autom4te.in
===================================================================
RCS file: /cvsroot/autoconf/autoconf/bin/autom4te.in,v
retrieving revision 1.72
diff -u -u -r1.72 autom4te.in
--- bin/autom4te.in 16 Oct 2002 17:06:57 -0000 1.72
+++ bin/autom4te.in 18 Oct 2002 15:20:23 -0000
@@ -632,6 +632,7 @@
. 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: tests/atspecific.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/atspecific.m4,v
retrieving revision 1.72
diff -u -u -r1.72 atspecific.m4
--- tests/atspecific.m4 16 Oct 2002 06:38:50 -0000 1.72
+++ tests/atspecific.m4 18 Oct 2002 15:20:24 -0000
@@ -18,6 +18,31 @@
# 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 @@
# 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: tests/m4sugar.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/m4sugar.at,v
retrieving revision 1.21
diff -u -u -r1.21 m4sugar.at
--- tests/m4sugar.at 29 Aug 2002 08:03:10 -0000 1.21
+++ tests/m4sugar.at 18 Oct 2002 15:20:24 -0000
@@ -61,9 +61,7 @@
[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 @@
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@&address@hidden: 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: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: tests/tools.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/tools.at,v
retrieving revision 1.67
diff -u -u -r1.67 tools.at
--- tests/tools.at 17 Oct 2002 09:57:31 -0000 1.67
+++ tests/tools.at 18 Oct 2002 15:20:24 -0000
@@ -128,9 +128,9 @@
# 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- m4 --fatal-warning,
Akim Demaille <=