X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/39ceb25bdbe9fe2a0963f55430a8dd44e82c3161..f7737e2e16cb9a49c258ac4b82b2b5f4fa9d0f18:/tests/torture.at?ds=sidebyside diff --git a/tests/torture.at b/tests/torture.at index 2e0cfc92..b9032d0c 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -19,6 +19,19 @@ AT_BANNER([[Torture Tests.]]) +# AT_INCREASE_DATA_SIZE(SIZE) +# ------------------------------------------- +# Try to increase the data size to SIZE KiB if possible. +m4_define([AT_INCREASE_DATA_SIZE], +[data_limit=`(ulimit -S -d) 2>/dev/null` +case $data_limit in +[[0-9]]*) + if test "$data_limit" -lt $1; then + ulimit -S -d $1 + fi +esac]) + + ## ------------------------------------- ## ## Creating a large artificial grammar. ## ## ------------------------------------- ## @@ -57,7 +70,7 @@ EOF for my $size (1 .. $max) { - print "%token \"$size\" ", $size, "\n"; + print "%token t$size $size \"$size\"\n"; }; print < ", " ", - map { "token$_" } (1 .. $max)), + map { "n$_" } (1 .. $max)), "\n"; for my $count (1 .. $max) { - print "%token \"$count\" $count\n"; + print "%token t$count $count \"$count\"\n"; }; print < 5120 is the last possible). -AT_CHECK([./input 10000], 1, [], [ignore]) +AT_PARSER_CHECK([./input 10000], 1, [], [ignore]) AT_CLEANUP @@ -442,11 +464,11 @@ AT_SETUP([Exploding the Stack Size with Malloc]) AT_DATA_STACK_TORTURE([[#define YYSTACK_USE_ALLOCA 0]]) # Below the limit of 200. -AT_CHECK([./input 20], 0, [], [ignore]) +AT_PARSER_CHECK([./input 20], 0, [], [ignore]) # Two enlargements: 2 * 2 * 200. -AT_CHECK([./input 900], 0, [], [ignore]) +AT_PARSER_CHECK([./input 900], 0, [], [ignore]) # Fails: beyond the limit of 10,000 (which we don't reach anyway since we # multiply by two starting at 200 => 5120 is the possible). -AT_CHECK([./input 10000], 1, [], [ignore]) +AT_PARSER_CHECK([./input 10000], 1, [], [ignore]) AT_CLEANUP