From: Akim Demaille Date: Mon, 12 Nov 2012 08:45:30 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/maint' X-Git-Tag: v2.7.90~274 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/fbca394ee1416fcfa41f839abc313a037732e84d Merge remote-tracking branch 'origin/maint' * origin/maint: maint: address syntax-check errors. tests: use valgrind where appropriate tests: use valgrind where appropriate tests: don't expect $EGREP to support -w tests: more possible error compiler messages for "#error" Conflicts: cfg.mk tests/headers.at --- fbca394ee1416fcfa41f839abc313a037732e84d diff --cc cfg.mk index 8e5a8e10,3f244aab..1aa1c1ab --- a/cfg.mk +++ b/cfg.mk @@@ -67,8 -85,8 +79,8 @@@ $(call exclude, prohibit_defined_have_decl_tests=?|^lib/timevar.c$$ \ prohibit_magic_number_exit=^doc/bison.texi$$ \ prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \ + prohibit_strcmp=^doc/bison\.texi$$ \ require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \ space_tab=^tests/(input|c\+\+)\.at$$ \ - unmarked_diagnostics=^(djgpp/|doc/bison.texi$$) \ - trailing_blank=^src/parse-gram.[ch]$$ \ + unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \ ) diff --cc tests/glr-regression.at index 80248aa4,7df17b62..ab6e1437 --- a/tests/glr-regression.at +++ b/tests/glr-regression.at @@@ -93,10 -88,10 +88,10 @@@ yylex (void AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([[-o glr-regr1.c glr-regr1.y]], 0, [], -[glr-regr1.y: conflicts: 1 shift/reduce -]) +[[glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +]]) AT_COMPILE([glr-regr1]) - AT_PARSER_CHECK([[echo BPBPB | ./glr-regr1]], 0, + AT_PARSER_CHECK([[./glr-regr1 BPBPB]], 0, [[E -> 'B' E -> 'B' E -> E 'P' E @@@ -208,14 -203,21 +203,21 @@@ main (int argc, char **argv AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([[-o glr-regr2a.c glr-regr2a.y]], 0, [], -[glr-regr2a.y: conflicts: 2 shift/reduce -]) +[[glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] +]]) AT_COMPILE([glr-regr2a]) - AT_PARSER_CHECK([[echo s VARIABLE_1 t v x q | ./glr-regr2a]], 0, + AT_DATA([input1.txt], + [[s VARIABLE_1 t v x q + ]]) + AT_PARSER_CHECK([[./glr-regr2a input1.txt]], 0, [[Variable: 'VARIABLE_1' - ]], []) - AT_PARSER_CHECK([[echo s VARIABLE_1 , ANOTHER_VARIABLE_2 t e | ./glr-regr2a]], + ]]) + + AT_DATA([input2.txt], + [[s VARIABLE_1 , ANOTHER_VARIABLE_2 t e + ]]) + AT_PARSER_CHECK([[./glr-regr2a input2.txt]], 0, [[Varlist: 'VARIABLE_1,ANOTHER_VARIABLE_2' ]]) @@@ -325,15 -331,17 +331,18 @@@ main(int argc, char* argv[] AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([[-o glr-regr3.c glr-regr3.y]], 0, [], -[glr-regr3.y: conflicts: 1 shift/reduce, 1 reduce/reduce -]) +[[glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] +glr-regr3.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] +]]) AT_COMPILE([glr-regr3]) - AT_PARSER_CHECK([[echo p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 | ./glr-regr3]], + AT_DATA([input.txt], + [[p1 t4 o2 p1 p1 t1 o1 t2 p2 o1 t3 p2 p2 + ]]) + AT_PARSER_CHECK([[./glr-regr3 input.txt]], 0, [[Result: 1c04 - ]], []) + ]]) AT_CLEANUP diff --cc tests/headers.at index 509a413d,dcf09a72..c21fa359 --- a/tests/headers.at +++ b/tests/headers.at @@@ -241,6 -225,36 +225,35 @@@ AT_TEST([x7], [%define api.push-pull bo AT_TEST([x8], [%define api.pure %define api.push-pull both]) #AT_TEST([x5], [%locations %language "c++" %glr-parser]) + # Check there is no 'yy' left. + # C++ output relies on namespaces and still uses yy a lot. + # + # Check there is no 'YY' left. -# Ignore comments, YYPARSE_PARAM (obsolete), YYPUSH_MORE(_DEFINED)? -# (constant definition), YY_\w+_INCLUDED (header guards). ++# Ignore comments, YYPUSH_MORE(_DEFINED)? (constant definition), ++# YY_\w+_INCLUDED (header guards). + # + # YYDEBUG (not renamed) can be read, but not changed. + AT_CHECK([[$PERL -n -0777 -e ' + s{/\*.*?\*/}{}gs; + s{//.*}{}g; - s{\b(YYPARSE_PARAM - |YYPUSH_MORE(_DEFINED)? ++ s{\b(YYPUSH_MORE(_DEFINED)? + |YY_\w+_INCLUDED + |YY_NULL + |(defined|if)\ YYDEBUG + )\b}{}gx; + while (/^(.*YY.*)$/gm) + { + print "$ARGV: $1\n"; + } + if ($ARGV =~ /\.h$/) + { + while (/^(.*yy.*)$/gm) + { + print "$ARGV: $1\n"; + } + } + ' -- *.hh *.h]]) + # Check that the headers are self-contained, and protected against # multiple inclusions. While at it, check they are sane for C++. for h in *.h *.hh