diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-01-18 07:25:58 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-01-19 14:51:14 +0100 |
commit | 91247f50d7539d593047c344ccea41b0a8f7a963 (patch) | |
tree | 303e535b7cdc3b9d93c9b6b0f6c20d7e6ea0b825 /tests | |
parent | f443673450656b1354941917d14ba962c5fa53f5 (diff) | |
download | bison-91247f50d7539d593047c344ccea41b0a8f7a963.tar.gz |
yacc.c: tests: check detailed error messages
* tests/local.at (AT_ERROR_DETAILED_IF): New.
(AT_ERROR_SIMPLE_IF): Adjust.
* tests/calc.at: Check parse.error=detailed.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/calc.at | 18 | ||||
-rw-r--r-- | tests/local.at | 5 |
2 files changed, 14 insertions, 9 deletions
diff --git a/tests/calc.at b/tests/calc.at index d309acb8..b3ffc4a3 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -798,24 +798,26 @@ AT_CHECK_CALC_LALR([%locations %define api.location.type {Span}]) AT_CHECK_CALC_LALR([%name-prefix "calc"]) AT_CHECK_CALC_LALR([%verbose]) AT_CHECK_CALC_LALR([%yacc]) +AT_CHECK_CALC_LALR([%define parse.error detailed]) AT_CHECK_CALC_LALR([%define parse.error verbose]) AT_CHECK_CALC_LALR([%define api.pure full %locations]) AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure full %locations]) -AT_CHECK_CALC_LALR([%define parse.error verbose %locations]) +AT_CHECK_CALC_LALR([%define parse.error detailed %locations]) -AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %define api.prefix {calc} %verbose %yacc]) -AT_CHECK_CALC_LALR([%define parse.error verbose %locations %defines %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error detailed %locations %defines %define api.prefix {calc} %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error detailed %locations %defines %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc]) AT_CHECK_CALC_LALR([%debug]) -AT_CHECK_CALC_LALR([%define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error detailed %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define parse.error detailed %debug %locations %defines %define api.prefix {calc} %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.pure full %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure full %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc]) +AT_CHECK_CALC_LALR([%define api.pure full %define parse.error detailed %debug %locations %defines %name-prefix "calc" %verbose %yacc]) +AT_CHECK_CALC_LALR([%define api.push-pull both %define api.pure full %define parse.error detailed %debug %locations %defines %define api.prefix {calc} %verbose %yacc]) -AT_CHECK_CALC_LALR([%define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}]) +AT_CHECK_CALC_LALR([%define api.pure %define parse.error detailed %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}]) +AT_CHECK_CALC_LALR([%no-lines %define api.pure %define parse.error detailed %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}]) AT_CHECK_CALC_LALR([%no-lines %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}]) diff --git a/tests/local.at b/tests/local.at index ee5beddf..9c32bc4b 100644 --- a/tests/local.at +++ b/tests/local.at @@ -206,10 +206,12 @@ m4_pushdef([AT_DEBUG_IF], [m4_bmatch([$3], [%debug\|%define parse.trace], [$1], [$2])]) m4_pushdef([AT_ERROR_CUSTOM_IF], [m4_bmatch([$3], [%define parse\.error custom], [$1], [$2])]) +m4_pushdef([AT_ERROR_DETAILED_IF], + [m4_bmatch([$3], [%define parse\.error detailed], [$1], [$2])]) m4_pushdef([AT_ERROR_VERBOSE_IF], [m4_bmatch([$3], [%define parse\.error verbose], [$1], [$2])]) m4_pushdef([AT_ERROR_SIMPLE_IF], - [AT_ERROR_CUSTOM_IF([$2], [AT_ERROR_VERBOSE_IF([$2], [$1])], [$1])]) + [AT_ERROR_CUSTOM_IF([$2], [AT_ERROR_DETAILED_IF([$2], [AT_ERROR_VERBOSE_IF([$2], [$1])], [$1])], [$1])]) m4_pushdef([AT_CXX_IF], [m4_bmatch([$3], [%language "[Cc]\+\+"\|%skeleton "[a-z0-9]+\.cc"], [$1], [$2])]) m4_pushdef([AT_D_IF], @@ -417,6 +419,7 @@ m4_popdef([AT_GLR_CC_IF]) m4_popdef([AT_LALR1_CC_IF]) m4_popdef([AT_ERROR_SIMPLE_IF]) m4_popdef([AT_ERROR_VERBOSE_IF]) +m4_popdef([AT_ERROR_DETAILED_IF]) m4_popdef([AT_ERROR_CUSTOM_IF]) m4_popdef([AT_DEBUG_IF]) m4_popdef([AT_DEFINES_IF]) |