tests: run the api.value.type tests for all C++ standards

* tests/local.at (AT_LANG_FOR_EACH_STD): New.
(AT_REQUIRE_CXX_VERSION): Rename as...
(AT_REQUIRE_CXX_STD): this.
Accept an argument for what to do when the requirement is not met.
* tests/types.at (api.value.type): Check all the C++ stds.
This commit is contained in:
Akim Demaille
2018-11-14 21:03:18 +01:00
parent 7bd7644702
commit 8eb1d79333
2 changed files with 40 additions and 20 deletions

View File

@@ -78,7 +78,7 @@ m4_pushdef([_AT_TEST],
[
AT_SETUP([$1])
AT_KEYWORDS([api.value.type])
$7
AT_BISON_OPTION_PUSHDEFS([%debug $1 $2])
AT_DATA_GRAMMAR([test.y],
[[%debug
@@ -104,9 +104,12 @@ start: $3;
]AT_MAIN_DEFINE[
]])
AT_FULL_COMPILE([[test]])
AT_PARSER_CHECK([[./test]], 0, [[$6
AT_LANG_FOR_EACH_STD([
$7
AT_FULL_COMPILE([[test]])
AT_PARSER_CHECK([[./test]], 0, [[$6
]])
])
AT_BISON_OPTION_POPDEFS
AT_CLEANUP
@@ -282,7 +285,7 @@ m4_foreach([b4_skel], [[yacc.c], [glr.c], [lalr1.cc], [glr.cc]],
]AT_VAL[.emplace <std::unique_ptr<std::string>>
(std::make_unique <std::string> ("two"));]],
[10, two],
[AT_REQUIRE_CXX_VERSION(14)])])
[AT_REQUIRE_CXX_STD(14, [echo "$at_std not supported"; continue])])])
])
])