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-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.
. 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)
# 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. ##
## ----------------- ##
# 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])])
[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
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...
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
# 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