mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 01:03:04 +00:00
tests: fix AT_BISON_CHECK_WARNINGS_ stderr rewriting
* tests/input.at (Deprecated directives): Avoid spurious error. * tests/locat.at (AT_BISON_CHECK_WARNINGS): Adjust for recent changes.
This commit is contained in:
@@ -445,10 +445,6 @@ m4_define([AT_BISON_CHECK],
|
|||||||
[m4_null_if([$2], [AT_BISON_CHECK_XML($@)])
|
[m4_null_if([$2], [AT_BISON_CHECK_XML($@)])
|
||||||
AT_BISON_CHECK_NO_XML($@)])
|
AT_BISON_CHECK_NO_XML($@)])
|
||||||
|
|
||||||
m4_define([AT_BISON_WERROR_MSG],
|
|
||||||
[[bison: warnings being treated as errors]])
|
|
||||||
|
|
||||||
|
|
||||||
# AT_BISON_CHECK_(BISON_ARGS, [OTHER_AT_CHECK_ARGS])
|
# AT_BISON_CHECK_(BISON_ARGS, [OTHER_AT_CHECK_ARGS])
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
# Low-level macro to run bison once.
|
# Low-level macro to run bison once.
|
||||||
@@ -483,33 +479,10 @@ if env | grep '^POSIXLY_CORRECT=' >/dev/null; then :; else
|
|||||||
|
|
||||||
# Build expected stderr up to and including the "warnings being
|
# Build expected stderr up to and including the "warnings being
|
||||||
# treated as errors" message.
|
# treated as errors" message.
|
||||||
]AT_DATA([[at-bison-check-warnings]], [$4])[
|
]AT_DATA([[experr]], [$4])[
|
||||||
at_bison_check_first=`sed -n \
|
$PERL -pi -e 's{(.*): warning: (.*)\[-W(.*)\]$}
|
||||||
'/: warning: /{=;q;}' at-bison-check-warnings`
|
{$][1: error: $][2\@<:@-Werror=$][3@:>@}' experr
|
||||||
: ${at_bison_check_first:=1}
|
]AT_CHECK([[sed 's,.*/$,,' stderr 1>&2]], [[0]], [[]], [experr])[
|
||||||
at_bison_check_first_tmp=`sed -n \
|
|
||||||
'/conflicts: [0-9].*reduce$/{=;q;}' at-bison-check-warnings`
|
|
||||||
: ${at_bison_check_first_tmp:=1}
|
|
||||||
if test $at_bison_check_first_tmp -lt $at_bison_check_first; then
|
|
||||||
at_bison_check_first=$at_bison_check_first_tmp
|
|
||||||
fi
|
|
||||||
if test $at_bison_check_first -gt 1; then
|
|
||||||
sed -n "1,`expr $at_bison_check_first - 1`"p \
|
|
||||||
at-bison-check-warnings > experr
|
|
||||||
fi
|
|
||||||
echo ']AT_BISON_WERROR_MSG[' >> experr
|
|
||||||
|
|
||||||
# Finish building expected stderr and check. Unlike warnings,
|
|
||||||
# complaints cause bison to exit early. Thus, with -Werror, bison
|
|
||||||
# does not necessarily report all warnings that it does without
|
|
||||||
# -Werror, but it at least reports one.
|
|
||||||
at_bison_check_last=`sed -n '$=' stderr`
|
|
||||||
: ${at_bison_check_last:=1}
|
|
||||||
at_bison_check_last=`expr $at_bison_check_last - 1`
|
|
||||||
sed -n "$at_bison_check_first,$at_bison_check_last"p \
|
|
||||||
at-bison-check-warnings >> experr
|
|
||||||
]AT_CHECK([[sed 's,.*/\(]AT_BISON_WERROR_MSG[\)$,\1,' \
|
|
||||||
stderr 1>&2]], [[0]], [[]], [experr])[
|
|
||||||
|
|
||||||
# Now check --warnings=error.
|
# Now check --warnings=error.
|
||||||
cp stderr experr
|
cp stderr experr
|
||||||
|
|||||||
Reference in New Issue
Block a user