summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2018-12-15 17:11:22 -0800
committerJim Meyering <meyering@fb.com>2018-12-15 18:37:14 -0800
commit7eeab0689a72e8f2283531c61bd5edb7c19a7608 (patch)
treea42a4649a26952f6f199742f085601a6c08dbf51 /tests
parent853f1e432888402f4b37a19345c68e76036526bf (diff)
downloadgrep-7eeab0689a72e8f2283531c61bd5edb7c19a7608.tar.gz
tests: stack-overflow: handle the case of success without the diagnostic
* tests/stack-overflow: Do not always require a stack overflow diagnostic.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/stack-overflow9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/stack-overflow b/tests/stack-overflow
index 69220455..492e959c 100755
--- a/tests/stack-overflow
+++ b/tests/stack-overflow
@@ -22,4 +22,13 @@ for i in 1 3 5 10 20 30 40 50 100 200; do
fi
done
+# If there was no stack overflow message and the final run exited with
+# status 1 and both stdout and stderr were empty, then assume it's a working
+# regex that avoids the internal stack overflow problem like glibc's regexp
+# used to.
+test $st = 1 \
+ && ! test -s out \
+ && ! test -s err \
+ && Exit 0
+
fail_ 'grep never printed "stack overflow"'