From bb1c50d88b1032fc5f4c338a4038b4c5e8fe0de6 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 28 Jan 2013 17:17:12 +0100 Subject: [PATCH] maint: fix syntax-check issues * cfg.mk: Ignore strcmp in local.at. * tests/conflicts.at: Use AT_PARSER_CHECK. * tests/regression.at: Preserve the exit status of the generated parsers. * tests/local.mk ($(TESTSUITE)): Map @tb@ to a tabulation. * tests/c++.at, tests/input.at, tests/regression.at: Use @tb@. * cfg.mk: (space-tab): There are no longer exceptions. --- cfg.mk | 3 +-- tests/c++.at | 5 +++-- tests/conflicts.at | 2 +- tests/input.at | 8 ++++---- tests/local.mk | 1 + tests/regression.at | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cfg.mk b/cfg.mk index a79566d3..7fbad01b 100644 --- a/cfg.mk +++ b/cfg.mk @@ -172,9 +172,8 @@ $(call exclude, \ prohibit_doubled_word=^tests/named-refs.at$$ \ prohibit_magic_number_exit=^doc/bison.texi$$ \ prohibit_magic_number_exit+=?|^tests/(conflicts|regression).at$$ \ - prohibit_strcmp=^doc/bison\.texi$$ \ + prohibit_strcmp=^doc/bison\.texi|tests/local\.at$$ \ prohibit_tab_based_indentation=\.(am|mk)$$|^djgpp/|^\.git \ require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$ \ - space_tab=^tests/(input|c\+\+)\.at$$ \ unmarked_diagnostics=^(djgpp/|doc/bison.texi$$|tests/c\+\+\.at$$) \ ) diff --git a/tests/c++.at b/tests/c++.at index b72954a2..874d6400 100644 --- a/tests/c++.at +++ b/tests/c++.at @@ -395,6 +395,7 @@ void ]AT_MAIN_DEFINE[ ]]) + AT_BISON_CHECK([[-o input.cc input.y]]) m4_if([$#], [1], @@ -413,8 +414,8 @@ AT_SETUP([[Absolute namespace references]]) AT_TEST([[::foo]]) AT_TEST([[::foo::bar]]) AT_TEST([[::foo::bar::baz]]) -AT_TEST([[ ::foo]]) -AT_TEST([[ ::foo::bar]]) +AT_TEST([[@tb@::foo]]) +AT_TEST([[ @tb@ ::foo::bar]]) AT_TEST([[ ::foo::bar::baz]]) AT_CLEANUP diff --git a/tests/conflicts.at b/tests/conflicts.at index 7828cdf0..8633d8d4 100644 --- a/tests/conflicts.at +++ b/tests/conflicts.at @@ -80,7 +80,7 @@ int main (void) AT_FULL_COMPILE([input]) -AT_CHECK([./input]) +AT_PARSER_CHECK([./input]) AT_BISON_OPTION_POPDEFS diff --git a/tests/input.at b/tests/input.at index 8184b03e..4d7308c1 100644 --- a/tests/input.at +++ b/tests/input.at @@ -1513,22 +1513,22 @@ AT_BISON_CHECK([[input.y]], [1], [], AT_CHECK_NAMESPACE_ERROR([[]], [[namespace reference is empty]]) -AT_CHECK_NAMESPACE_ERROR([[ ]], +AT_CHECK_NAMESPACE_ERROR([[ @tb@@tb@ @tb@ @tb@]], [[namespace reference is empty]]) AT_CHECK_NAMESPACE_ERROR([[foo::::bar]], [[namespace reference has consecutive "::"]]) -AT_CHECK_NAMESPACE_ERROR([[foo:: ::bar]], +AT_CHECK_NAMESPACE_ERROR([[foo:: @tb@::bar]], [[namespace reference has consecutive "::"]]) AT_CHECK_NAMESPACE_ERROR([[::::bar]], [[namespace reference has consecutive "::"]]) AT_CHECK_NAMESPACE_ERROR([[:: ::bar]], [[namespace reference has consecutive "::"]]) -AT_CHECK_NAMESPACE_ERROR([[foo::bar:: ::]], +AT_CHECK_NAMESPACE_ERROR([[foo::bar::@tb@::]], [[namespace reference has consecutive "::"]], [[namespace reference has a trailing "::"]]) AT_CHECK_NAMESPACE_ERROR([[foo::bar::]], [[namespace reference has a trailing "::"]]) -AT_CHECK_NAMESPACE_ERROR([[foo::bar:: ]], +AT_CHECK_NAMESPACE_ERROR([[foo::bar:: @tb@]], [[namespace reference has a trailing "::"]]) AT_CHECK_NAMESPACE_ERROR([[::]], [[namespace reference has a trailing "::"]]) diff --git a/tests/local.mk b/tests/local.mk index ede62aa7..7bc8b789 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -72,6 +72,7 @@ AUTOTESTFLAGS = -I $(top_srcdir)/tests $(TESTSUITE): $(TESTSUITE_AT) $(AM_V_GEN) \ $(AUTOTEST) $(AUTOTESTFLAGS) $(srcdir)/tests/testsuite.at -o $@.tmp + $(AM_V_at)$(PERL) -pi -e 's/\@tb\@/\t/g' $@.tmp $(AM_V_at)mv $@.tmp $@ diff --git a/tests/regression.at b/tests/regression.at index 418faf05..02840bb3 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -1545,7 +1545,7 @@ AT_DATA_GRAMMAR([input.y], %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { @&t@ - int y @&t@ +@tb@ int y@tb@ @&t@ @&t@ @&t@ } @@ -1573,7 +1573,7 @@ yyparse (int x, int y) int main (void) { - return !!yyparse(1, 2); + return yyparse(1, 2); } ]]) -- 2.45.2