tests: support api.prefix.

* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
Define AT_API_PREFIX.
(AT_YYERROR_DEFINE, AT_YYERROR_DECLARE_EXTERN, AT_YYLEX_DECLARE_EXTERN)
(AT_YYLEX_DEFINE): Use it.
* tests/input.at, tests/regression.at, tests/torture.at: Add
AT_BISON_OPTION_PUSHDEFS/POPDEFS.
This commit is contained in:
Akim Demaille
2012-06-17 18:52:59 +02:00
parent 5f7f1e210b
commit 71c7e24f2e
4 changed files with 56 additions and 48 deletions

View File

@@ -391,7 +391,7 @@ AT_CLEANUP
AT_SETUP([Torturing the Scanner])
AT_BISON_OPTION_PUSHDEFS
AT_DATA([input.y], [])
AT_BISON_CHECK([input.y], [1], [],
[[input.y:1.1: syntax error, unexpected end of file
@@ -501,7 +501,7 @@ value_as_yystype (value val)
res.ival = val;
return res;
}
]AT_YYERROR_DEFINE[
static int
yylex (void)
{
@@ -514,15 +514,9 @@ yylex (void)
yylval = value_as_yystype (input[toknum]);
return input[toknum++];
}
static void
yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
]])
# Pacify Emacs'font-lock-mode: "
# Pacify Emacs' font-lock-mode: "
AT_DATA([main.c],
[[typedef int value;
@@ -536,6 +530,7 @@ main (void)
return yyparse ();
}
]])
AT_BISON_OPTION_POPDEFS
AT_BISON_CHECK([-d -v -o input.c input.y])
AT_COMPILE([input.o], [-c input.c])