summaryrefslogtreecommitdiff
path: root/tests/pcre-jitstack
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2019-02-17 17:47:30 -0800
committerJim Meyering <meyering@fb.com>2019-02-18 10:51:52 -0800
commit3b232c7e2c408eec801c4a69eb23c42b1e22c17c (patch)
tree70d58f8f7be599742c049d8f40a5811c4801429a /tests/pcre-jitstack
parent6861bd8698b3177816fcc4d1a892df6e0701f1f6 (diff)
downloadgrep-3b232c7e2c408eec801c4a69eb23c42b1e22c17c.tar.gz
tests: avoid false positive upon stack overflow
* tests/pcre-jitstack: Don't let a stack overflow evoke a false failure. This test is to ensure there is no internal PCRE error. Reported by Andreas Schwab in http://bugs.gnu.org/34370
Diffstat (limited to 'tests/pcre-jitstack')
-rwxr-xr-xtests/pcre-jitstack5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/pcre-jitstack b/tests/pcre-jitstack
index a6c9c21c..070074f7 100755
--- a/tests/pcre-jitstack
+++ b/tests/pcre-jitstack
@@ -52,8 +52,11 @@ if test $? != 1; then
# Rerun that same test, but now with no limit on stack size:
(ulimit -s unlimited;
- returns_ 1 env LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt) \
+ returns_ 1 env LC_ALL=C grep -P -n '^([/](?!/)|[^/])*~/.*' pcrejit.txt 2> err) \
|| fail=1
+
+ # If that failed due to stack overflow, don't cry foul.
+ test $fail = 1 && { grep -q 'stack overflow' err && fail=0 || cat err; }
fi
Exit $fail