mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 18:23:03 +00:00
tests: simplify AT_PARSER_CHECK usage
Currently the caller must specify the ./ prefix to its command. Let's avoid that: it will be nicer to read, make it easier to have a version that works for Java and C/C++. * tests/local.at (AT_PARSER_CHECK): Prefix the command with ./. Adjust callers.
This commit is contained in:
40
tests/c++.at
40
tests/c++.at
@@ -84,7 +84,7 @@ main (void)
|
||||
|
||||
AT_FOR_EACH_CXX([
|
||||
AT_FULL_COMPILE([input])
|
||||
AT_PARSER_CHECK([./input], 0)
|
||||
AT_PARSER_CHECK([input], 0)
|
||||
])
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
AT_CLEANUP
|
||||
@@ -220,7 +220,7 @@ int main()
|
||||
AT_BISON_CHECK([[-o list.cc list.yy]])
|
||||
AT_FOR_EACH_CXX([
|
||||
AT_COMPILE_CXX([list])
|
||||
AT_PARSER_CHECK([./list])
|
||||
AT_PARSER_CHECK([list])
|
||||
])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
@@ -491,7 +491,7 @@ else
|
||||
fi
|
||||
|
||||
if AT_AUTOMOVE_IF([$modern], [false]); then
|
||||
AT_PARSER_CHECK([./list], 0,
|
||||
AT_PARSER_CHECK([list], 0,
|
||||
[[(0, 1, 2, 4, 6)
|
||||
]],
|
||||
[[Destroy: ""
|
||||
@@ -517,7 +517,7 @@ Destroy: ()
|
||||
Destroy: (0, 1, 2, 4, 6)
|
||||
]])
|
||||
else
|
||||
AT_PARSER_CHECK([./list], 0,
|
||||
AT_PARSER_CHECK([list], 0,
|
||||
[[(0, 1, 2, 4, 6)
|
||||
]],
|
||||
[[Destroy: "0"
|
||||
@@ -645,7 +645,7 @@ int main()
|
||||
AT_FOR_EACH_CXX([
|
||||
AT_FULL_COMPILE([[input]])
|
||||
# This used to print "Discarding 'a'." again at the end.
|
||||
AT_PARSER_CHECK([[./input]], [[0]], [[]],
|
||||
AT_PARSER_CHECK([[input]], [[0]], [[]],
|
||||
[[Starting parse
|
||||
Entering state 0
|
||||
Reading a token: Next token is token NUMBER (1)
|
||||
@@ -821,7 +821,7 @@ AT_BISON_CHECK([[-o input.cc input.yy]])
|
||||
m4_if([$#], [1],
|
||||
[AT_FOR_EACH_CXX([
|
||||
AT_COMPILE_CXX([[input]])
|
||||
AT_PARSER_CHECK([[./input]])])])
|
||||
AT_PARSER_CHECK([[input]])])])
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
])
|
||||
|
||||
@@ -921,7 +921,7 @@ yy::parser::error (const std::string &m)
|
||||
AT_FOR_EACH_CXX([
|
||||
AT_FULL_COMPILE([[input]])
|
||||
# This used to print "Discarding 'a'." again at the end.
|
||||
AT_PARSER_CHECK([[./input]], [[1]], [[]],
|
||||
AT_PARSER_CHECK([[input]], [[1]], [[]],
|
||||
[[syntax error
|
||||
Discarding 'a'.
|
||||
Reducing 'a'.
|
||||
@@ -1016,7 +1016,7 @@ AT_FOR_EACH_CXX([
|
||||
# previous error, otherwise we might hide some error messages
|
||||
# (discarded during error recoevery).
|
||||
echo "asaaalaa" >in
|
||||
AT_PARSER_CHECK([[./input < in]], [[0]], [[]],
|
||||
AT_PARSER_CHECK([[input < in]], [[0]], [[]],
|
||||
[[error: invalid expression
|
||||
caught error
|
||||
error: invalid character
|
||||
@@ -1024,12 +1024,12 @@ caught error
|
||||
]])
|
||||
|
||||
echo "!as" >in
|
||||
AT_PARSER_CHECK([[./input < in]], [1], [],
|
||||
AT_PARSER_CHECK([[input < in]], [1], [],
|
||||
[[error: invalid expression
|
||||
]])
|
||||
|
||||
echo "!al" >in
|
||||
AT_PARSER_CHECK([[./input < in]], [1], [],
|
||||
AT_PARSER_CHECK([[input < in]], [1], [],
|
||||
[[error: invalid character
|
||||
]])
|
||||
|
||||
@@ -1299,34 +1299,34 @@ AT_BISON_CHECK([[-o input.cc --report=all input.yy]])
|
||||
AT_FOR_EACH_CXX([
|
||||
AT_COMPILE_CXX([[input]])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaas]], [[2]], [[]],
|
||||
AT_PARSER_CHECK([[input aaaas]], [[2]], [[]],
|
||||
[[exception caught: reduction
|
||||
]])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaal]], [[2]], [[]],
|
||||
AT_PARSER_CHECK([[input aaaal]], [[2]], [[]],
|
||||
[[exception caught: yylex
|
||||
]])
|
||||
|
||||
AT_PARSER_CHECK([[./input i]], [[2]], [[]],
|
||||
AT_PARSER_CHECK([[input i]], [[2]], [[]],
|
||||
[[exception caught: initial-action
|
||||
]])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaap]])
|
||||
AT_PARSER_CHECK([[input aaaap]])
|
||||
|
||||
AT_PARSER_CHECK([[./input --debug aaaap]], [[2]], [[]], [[stderr]])
|
||||
AT_PARSER_CHECK([[input --debug aaaap]], [[2]], [[]], [[stderr]])
|
||||
AT_CHECK([[grep '^exception caught: printer$' stderr]], [], [ignore])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaae]], [[2]], [[]],
|
||||
AT_PARSER_CHECK([[input aaaae]], [[2]], [[]],
|
||||
[[exception caught: syntax error
|
||||
]])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaaE]], [[2]], [[]],
|
||||
AT_PARSER_CHECK([[input aaaaE]], [[2]], [[]],
|
||||
[[exception caught: syntax error, unexpected $end, expecting 'a'
|
||||
]])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaaT]], [[1]])
|
||||
AT_PARSER_CHECK([[input aaaaT]], [[1]])
|
||||
|
||||
AT_PARSER_CHECK([[./input aaaaR]], [m4_if([$2], [with], [0], [1])])
|
||||
AT_PARSER_CHECK([[input aaaaR]], [m4_if([$2], [with], [0], [1])])
|
||||
])
|
||||
|
||||
AT_BISON_OPTION_POPDEFS
|
||||
@@ -1476,6 +1476,6 @@ main (void)
|
||||
|
||||
|
||||
AT_COMPILE_CXX([parser], [[x[12].o main.cc]], [-Iinclude])
|
||||
AT_PARSER_CHECK([./parser], [0])
|
||||
AT_PARSER_CHECK([parser], [0])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user