diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2022-09-20 08:19:02 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2022-09-20 08:25:06 +0200 |
commit | 25b3d0e1a3f97a33615099e4b211f3953990c203 (patch) | |
tree | 8c57cb04ae243556b3bb3c860c3503cf09ea25ed /tests/input.at | |
parent | de3041b69a72f7a027f20082d8c1eb605d01f9dd (diff) | |
download | bison-25b3d0e1a3f97a33615099e4b211f3953990c203.tar.gz |
cex: check -Dcex.timeout
* src/counterexample.c (counterexample_init): Remove stray debug
trace.
Complain about invalid values.
* tests/input.at (-Dcex.timeout): New.
Diffstat (limited to 'tests/input.at')
-rw-r--r-- | tests/input.at | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/input.at b/tests/input.at index 5cacb066..04b31f99 100644 --- a/tests/input.at +++ b/tests/input.at @@ -3283,3 +3283,39 @@ AT_TEST([-M foo= -M baz], [baz], [<command line>:6]) m4_popdef([AT_TEST]) AT_CLEANUP + + +## --------------- ## +## -Dcex.timeout. ## +## --------------- ## + +AT_SETUP([[-Dcex.timeout]]) + +AT_KEYWORDS([cex]) + +# AT_TEST(OPTIONS) +# ---------------- +m4_pushdef([AT_TEST], +[AT_DATA([[input.y]], +[[ +%% +exp: %empty; +]]) +AT_BISON_CHECK([[$1 input.y]], [[$2]], [[]], [m4_ifvaln([$3], [$3])]) +]) + +# It's ok to define the timeout even if we don't run -Wcex. +AT_TEST([-Dcex.timeout=1], [0]) +AT_TEST([-Dcex.timeout=1 -Wcex], [0]) +AT_TEST([-Dcex.timeout=1.5 -Wcex], [0]) +# No time at all. Not really wrong. +AT_TEST([-Dcex.timeout=0 -Wcex], [0]) + +AT_TEST([-Dcex.timeout=foo -Wcex], [1], + [[<command line>:3: error: invalid value for %define variable 'cex.timeout': 'foo']]) +AT_TEST([-Dcex.timeout=-1.5 -Wcex], [1], + [[<command line>:3: error: invalid value for %define variable 'cex.timeout': '-1.5']]) + +m4_popdef([AT_TEST]) + +AT_CLEANUP |