tests: generalize default main for api.namespace

* tests/local.at (AT_NAME_PREFIX): Also match api.namespace.
(AT_MAIN_DEFINE): Take it into account.
* tests/c++.at, tests/headers.at: Use AT_NAME_PREFIX.
(AT_CHECK_NAMESPACE): Rename as...
(AT_TEST): this.
This commit is contained in:
Akim Demaille
2013-01-21 16:01:53 +01:00
parent f42c012fcf
commit 56b91ae0b1
3 changed files with 33 additions and 50 deletions

View File

@@ -68,30 +68,21 @@ AT_TEST_CPP_GUARD_H([9foo], [%glr-parser])
AT_SETUP([export YYLTYPE])
AT_BISON_OPTION_PUSHDEFS([%name-prefix "my_"])
AT_DATA_GRAMMAR([input.y],
[%locations
[[%locations
%name-prefix "my_"
%{
#include <stdio.h>
#include <stdlib.h>
static int
my_lex (void)
{
return EOF;
}
static void
my_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
]AT_YYERROR_DEFINE[
]AT_YYLEX_DEFINE[
%}
%%
exp:;
])
]])
AT_BISON_CHECK([--defines -o input.c input.y])
@@ -102,11 +93,7 @@ YYLTYPE *my_llocp = &my_lloc;
int my_parse (void);
int
main (void)
{
return my_parse ();
}
]AT_MAIN_DEFINE[
]])
# Link and execute, just to make sure everything is fine (and in
@@ -115,7 +102,7 @@ AT_COMPILE([caller.o])
AT_COMPILE([input.o])
AT_COMPILE([caller], [caller.o input.o])
AT_PARSER_CHECK([./caller])
AT_BISON_OPTION_POPDEFS
AT_CLEANUP
## ----------------- ##