tests: refactor checks on sets

It will be convenient to check sets elsewhere.

* tests/sets.at (AT_EXTRACT_SETS): Transform into...
* tests/local.at (AT_SETS_CHECK): this.
* tests/sets.at: Adjust.
This commit is contained in:
Akim Demaille
2019-05-02 15:40:14 +02:00
parent 65126716d7
commit 7f017ae1c9
2 changed files with 25 additions and 43 deletions

View File

@@ -1353,6 +1353,29 @@ m4_popdef([AT_COND_CASE])])
# AT_SETS_CHECK(INPUT, SETS, EXPECTED)
# ------------------------------------
# Extract the information about the grammar sets from a bison
# trace output (INPUT), and compare to EXPECTED.
#
# And remember, there is no alternation in portable sed.
m4_define([AT_SETS_CHECK],
[AT_DATA([extract.sed],
[[#n
]m4_foreach([m4_Set], [$2], [[
/^]m4_Set[/ {
:]m4_Set[
p
n
/^ *$/ !b ]m4_Set[
}
]])])
AT_CHECK([sed -f extract.sed $1], 0, [$3])
])
## ----------------------- ##
## Launch the test suite. ##