From acc520924ce85ae5b5c936d07e07fa3aa2a2dbc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Tue, 9 Nov 2021 09:23:02 -0800 Subject: [PATCH] test: avoid failing RunTest if pcre2test -S is not supported (#37) * test: avoid failing RunTest if pcre2test -S is not supported If `pcre2test -S` is not supported then then avoid checking for it in a test. There is already a conditional check for it to be used when it is needed and it is available, so adjust that as well. * pcre2test: update list of platform support for -S Minix 3 has a BSD userspace and now works fine, but Haiku still doesn't support stack limits, so update accordingly. --- RunTest | 7 +++++-- src/pcre2test.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/RunTest b/RunTest index 14d9f60..605eb09 100755 --- a/RunTest +++ b/RunTest @@ -320,7 +320,8 @@ fi # set up a large stack. $sim ./pcre2test -S 64 /dev/null /dev/null -if [ $? -eq 0 -a "$bigstack" != "" ] ; then +support_setstack=$? +if [ $support_setstack -eq 0 -a "$bigstack" != "" ] ; then setstack="-S 64" else setstack="" @@ -479,7 +480,9 @@ for bmode in "$test8" "$test16" "$test32"; do echo '' >testtry checkspecial '-C' checkspecial '--help' - checkspecial '-S 1 -t 10 testSinput' + if [ $support_setstack -eq 0 ] ; then + checkspecial '-S 1 -t 10 testSinput' + fi echo " OK" fi diff --git a/src/pcre2test.c b/src/pcre2test.c index 84987d7..8062467 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -8689,7 +8689,7 @@ while (argc > 1 && argv[op][0] == '-' && argv[op][1] != 0) else if (strcmp(arg, "-S") == 0 && argc > 2 && ((uli = strtoul(argv[op+1], &endptr, 10)), *endptr == 0)) { -#if defined(_WIN32) || defined(WIN32) || defined(__minix) || defined(NATIVE_ZOS) || defined(__VMS) +#if defined(_WIN32) || defined(WIN32) || defined(__HAIKU__) || defined(NATIVE_ZOS) || defined(__VMS) fprintf(stderr, "pcre2test: -S is not supported on this OS\n"); exit(1); #else