[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/6] style: tests: simplify the handling of some C++ tests
From: |
Akim Demaille |
Subject: |
[PATCH 6/6] style: tests: simplify the handling of some C++ tests |
Date: |
Thu, 8 Jan 2015 14:52:49 +0100 |
* tests/c++.at: here.
(Doxygen): Pass %define, so that files such as position.hh etc.
are generated, instead of putting everything into input.hh.
---
tests/c++.at | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
diff --git a/tests/c++.at b/tests/c++.at
index 3030401..e6d6983 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -369,6 +369,7 @@ AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc"])
AT_DATA([input.yy],
[[%skeleton "lalr1.cc"
%locations
+%defines
%debug
%%
exp: /* empty */;
@@ -376,7 +377,7 @@ exp: /* empty */;
]AT_YYERROR_DEFINE[
]])
-AT_BISON_CHECK([-o input.cc input.yy], 0)
+AT_BISON_CHECK([-o input.cc input.yy])
AT_DATA([Doxyfile],
[# The PROJECT_NAME tag is a single word (or a sequence of words
@@ -447,7 +448,7 @@ AT_CHECK_DOXYGEN([Private])
# so don't check compilation.
m4_pushdef([AT_TEST],
[AT_BISON_OPTION_PUSHDEFS([%language "C++" %define api.namespace {$1}])
-AT_DATA_GRAMMAR([[input.y]],
+AT_DATA_GRAMMAR([[input.yy]],
[[%language "C++"
%define api.namespace {]$1[}
%union { int i; }
@@ -479,10 +480,10 @@ void
]])
-AT_BISON_CHECK([[-o input.cc input.y]])
+AT_BISON_CHECK([[-o input.cc input.yy]])
m4_if([$#], [1],
-[AT_COMPILE_CXX([[input]], [[input.cc]])
+[AT_COMPILE_CXX([[input]])
AT_PARSER_CHECK([[./input]])])
AT_BISON_OPTION_POPDEFS
])
@@ -526,7 +527,7 @@ AT_SETUP([[Syntax error discarding no lookahead]])
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc"])
-AT_DATA_GRAMMAR([[input.yy]],
+AT_DATA_GRAMMAR([[input.y]],
[[%skeleton "lalr1.cc"
%code {
@@ -579,8 +580,7 @@ yy::parser::error (const std::string &m)
]AT_MAIN_DEFINE[
]])
-AT_BISON_CHECK([[-o input.cc input.yy]])
-AT_COMPILE_CXX([[input]])
+AT_FULL_COMPILE([[input]])
# This used to print "Discarding 'a'." again at the end.
AT_PARSER_CHECK([[./input]], [[1]], [[]],
[[syntax error
@@ -600,7 +600,7 @@ AT_SETUP([[Syntax error as exception]])
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc"])
-AT_DATA_GRAMMAR([[input.yy]],
+AT_DATA_GRAMMAR([[input.y]],
[[%skeleton "lalr1.cc"
%code
@@ -655,8 +655,7 @@ yy::parser::error (const std::string &m)
]AT_MAIN_DEFINE[
]])
-AT_BISON_CHECK([[-o input.cc input.yy]])
-AT_COMPILE_CXX([[input]])
+AT_FULL_COMPILE([[input]])
AT_PARSER_CHECK([[./input]], [[0]], [[]],
[[error: invalid expression
@@ -953,9 +952,9 @@ AT_TEST([%define api.value.type variant], [without])
m4_popdef([AT_TEST])
-## ------------------------------------ ##
-## C++ GLR parser identifier shadowing ##
-## ------------------------------------ ##
+## ------------------------------------- ##
+## C++ GLR parser identifier shadowing. ##
+## ------------------------------------- ##
AT_SETUP([[C++ GLR parser identifier shadowing]])
@@ -991,7 +990,7 @@ int yylex (yy::parser::semantic_type *yylval)
void yy::parser::error (std::string const&)
{}
-int main()
+int main ()
{}
])
--
2.2.1
- [PATCH 0/6] maint: c++: clean up the handling of the lookahead, Akim Demaille, 2015/01/09
- [PATCH 2/6] c++: clean up the handling of empty symbols, Akim Demaille, 2015/01/09
- [PATCH 4/6] c++: variants: don't leak the lookahead in error recovery, Akim Demaille, 2015/01/09
- [PATCH 3/6] c++: provide a means to clear symbols, Akim Demaille, 2015/01/09
- [PATCH 6/6] style: tests: simplify the handling of some C++ tests,
Akim Demaille <=
- [PATCH 1/6] c++: comment and style changes, Akim Demaille, 2015/01/09
- [PATCH 5/6] c++: symbols can be empty, so use it, Akim Demaille, 2015/01/09