diff options
author | Akim Demaille <demaille@gostai.com> | 2012-02-22 14:42:59 +0100 |
---|---|---|
committer | Akim Demaille <akim@lrde.epita.fr> | 2012-03-13 12:01:45 +0100 |
commit | 05061eca7cb874cb5d0d2faa7b464c09128f1e77 (patch) | |
tree | c254b13096ff3a0abc92480a48b54dbce5634d7b | |
parent | 06e0e52ca4450a00113d5a157e791363bf57de83 (diff) | |
download | bison-maint.tar.gz |
tests: minor fixes/simplificationsmaint
* tests/local.at (AT_BISON_CHECK_NO_XML): Simplify sed programs,
quotation, and default value assignments.
Ensure a proper value to the numeric variables.
Reported by Lie Yan.
http://lists.gnu.org/archive/html/bug-bison/2012-03/msg00000.html
-rw-r--r-- | tests/local.at | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/tests/local.at b/tests/local.at index f3693158..dd4cd555 100644 --- a/tests/local.at +++ b/tests/local.at @@ -298,14 +298,12 @@ m4_if(m4_bregexp([$4], [: warning: ]), [-1], [], # Build expected stderr up to and including the "warnings being # treated as errors" message. ]AT_DATA([[at-bison-check-warnings]], [$4])[ - at_bison_check_first="` \ - sed -n '/: warning: /=' at-bison-check-warnings \ - | sed -n 1p \ - `" - at_bison_check_first_tmp="` \ - sed -n '/conflicts: [0-9].*reduce$/=' at-bison-check-warnings \ - | sed -n 1p \ - `" + at_bison_check_first=`sed -n \ + '/: warning: /{=;q;}' at-bison-check-warnings` + : ${at_bison_check_first:=1} + 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 @@ -319,11 +317,9 @@ m4_if(m4_bregexp([$4], [: warning: ]), [-1], [], # 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`" - if test x"$at_bison_check_last" = x; then - at_bison_check_last=1 - fi - at_bison_check_last="`expr $at_bison_check_last - 1`" + 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,' \ |