[Pcre-svn] [675] code/trunk/RunTest: Remove special stack ha…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [675] code/trunk/RunTest: Remove special stack handling for test 2 - no longer needed.
Revision: 675
          http://www.exim.org/viewvc/pcre2?view=rev&revision=675
Author:   ph10
Date:     2017-03-10 17:48:48 +0000 (Fri, 10 Mar 2017)
Log Message:
-----------
Remove special stack handling for test 2 - no longer needed.


Modified Paths:
--------------
    code/trunk/RunTest


Modified: code/trunk/RunTest
===================================================================
--- code/trunk/RunTest    2017-03-10 16:34:54 UTC (rev 674)
+++ code/trunk/RunTest    2017-03-10 17:48:48 UTC (rev 675)
@@ -308,27 +308,14 @@
   exit 1
 fi


-# If it is possible to set the system stack size, arrange to set a value for
-# test 2, which needs more than the even the Linux default when PCRE2 has been
-# compiled by gcc with -fsanitize=address. If "bigstack" is on the command
-# line, set even bigger numbers. When the compiler is clang, sanitize options
-# require an even bigger stack for test 2, and an increased stack for some of
-# the other tests. Test 2 now has code to automatically try again with a 64M
-# stack if it crashes when test2stack is "-S 16" when matching with the
-# interpreter.
+# If it is possible to set the system stack size and -bigstack was given,
+# set up a large stack.

 $sim ./pcre2test -S 1 /dev/null /dev/null
-if [ $? -eq 0 ] ; then
-  if [ "$bigstack" = "" ] ; then
-    test2stack="-S 16"
-    defaultstack=""
-  else
-    test2stack="-S 1024"
-    defaultstack="-S 64"
-  fi
+if [ $? -eq 0 -a "$bigstack" != "" ] ; then
+  setstack="-S 16"
 else
-  test2stack=""
-  defaultstack=""
+  setstack=""
 fi


 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
@@ -490,7 +477,7 @@
   if [ $do1 = yes ] ; then
     echo $title1
     for opt in "" $jitopt; do
-      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput1 testtry
+      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput1 testtry
       checkresult $? 1 "$opt"
     done
   fi
@@ -500,34 +487,10 @@
   if [ $do2 = yes ] ; then
     echo $title2 "(excluding UTF-$bits)"
     for opt in "" $jitopt; do
-      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $test2stack $bmode $opt $testdata/testinput2 testtry
+      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput2 testtry
       if [ $? = 0 ] ; then
         $sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -63,-62,-2,-1,0,100,188,189,190,191 >>testtry
         checkresult $? 2 "$opt"
-      else
-        echo " "
-        echo "** Test 2, when run under the interpreter, requires a lot of stack."
-        echo "** If it has crashed with a segmentation fault, it may be that you"
-        echo "** do not have enough stack available by default. Please see the"
-        echo "** 'pcre2stack' man page for a discussion of PCRE2's stack usage."
-        if [ "$test2stack" != "-S 16" -o "$opt" != "" ]; then
-          echo " "
-          exit 1
-        fi
-        echo " "
-        echo "** Trying again with an increased stack size."
-        echo " "
-        echo $title2 "(excluding UTF-$bits) (64M stack)"
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q -S 64 $bmode $opt $testdata/testinput2 testtry
-        if [ $? = 0 ] ; then
-          $sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -63,-62,-2,-1,0,100,188,189,190,191 >>testtry
-          checkresult $? 2 "$opt"
-        else
-          echo " "
-          echo "** Failed with an increased stack size. Tests abandoned."
-          echo " "
-          exit 1
-        fi
       fi
     done
   fi
@@ -577,7 +540,7 @@
     if [ "$locale" != "" ] ; then
       echo $title3 "(using '$locale' locale)"
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $infile testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $infile testtry
         if [ $? = 0 ] ; then
           case "$opt" in
             -jit) with=" with JIT";;
@@ -614,7 +577,7 @@
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput4 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput4 testtry
         checkresult $? 4 "$opt"
       done
     fi
@@ -626,7 +589,7 @@
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput5 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput5 testtry
         checkresult $? 5 "$opt"
       done
     fi
@@ -636,7 +599,7 @@


   if [ $do6 = yes ] ; then
     echo $title6
-    $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput6 testtry
+    $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput6 testtry
     checkresult $? 6 ""
   fi


@@ -645,7 +608,7 @@
     if [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput7 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput7 testtry
       checkresult $? 7 ""
     fi
   fi
@@ -663,7 +626,7 @@
     if [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput8 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput8 testtry
       checkresult $? 8-$bits-$link_size ""
     fi
   fi
@@ -676,7 +639,7 @@
       echo "  Skipped when running 16/32-bit tests"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput9 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput9 testtry
         checkresult $? 9 "$opt"
       done
     fi
@@ -692,7 +655,7 @@
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput10 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput10 testtry
         checkresult $? 10 "$opt"
       done
     fi
@@ -706,7 +669,7 @@
       echo "  Skipped when running 8-bit tests"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput11 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput11 testtry
         checkresult $? 11-$bits "$opt"
       done
     fi
@@ -723,7 +686,7 @@
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput12 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput12 testtry
         checkresult $? 12-$bits "$opt"
       done
     fi
@@ -736,7 +699,7 @@
     if [ "$bits" = "8" ] ; then
       echo "  Skipped when running 8-bit tests"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput13 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput13 testtry
       checkresult $? 13 ""
     fi
   fi
@@ -748,7 +711,7 @@
     if [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput14 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput14 testtry
       checkresult $? 14-$bits ""
     fi
   fi
@@ -757,7 +720,7 @@


   if [ $do15 = yes ] ; then
     echo $title15
-    $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput15 testtry
+    $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput15 testtry
     checkresult $? 15 ""
   fi


@@ -768,7 +731,7 @@
     if [ $jit -ne 0 ] ; then
       echo "  Skipped because JIT is available"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput16 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput16 testtry
       checkresult $? 16 ""
     fi
   fi
@@ -780,7 +743,7 @@
     if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
       echo "  Skipped because JIT is not available or nojit was specified"
     else
-      $sim $valgrind $vjs ./pcre2test -q $defaultstack $bmode $testdata/testinput17 testtry
+      $sim $valgrind $vjs ./pcre2test -q $setstack $bmode $testdata/testinput17 testtry
       checkresult $? 17 ""
     fi
   fi
@@ -792,7 +755,7 @@
     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
       echo "  Skipped when running 16/32-bit tests"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput18 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput18 testtry
       checkresult $? 18 ""
     fi
   fi
@@ -806,7 +769,7 @@
     elif [ $utf -eq 0 ] ; then
       echo "  Skipped because UTF-$bits support is not available"
     else
-      $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput19 testtry
+      $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput19 testtry
       checkresult $? 19 ""
     fi
   fi
@@ -815,7 +778,7 @@


   if [ $do20 = yes ] ; then
     echo $title20
-    $sim $valgrind ./pcre2test -q $defaultstack $bmode $testdata/testinput20 testtry
+    $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput20 testtry
     checkresult $? 20 ""
   fi


@@ -827,7 +790,7 @@
       echo "  Skipped because \C is disabled"
     else
       for opt in "" $jitopt -dfa; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput21 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput21 testtry
         checkresult $? 21 "$opt"
       done
     fi
@@ -843,7 +806,7 @@
       echo "  Skipped because UTF-$bits support is not available"
     else
       for opt in "" $jitopt; do
-        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput22 testtry
+        $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput22 testtry
         checkresult $? 22-$bits "$opt"
       done
     fi
@@ -856,7 +819,7 @@
     if [ $supportBSC -ne 0 ] ; then
       echo "  Skipped because \C is not disabled"
     else
-      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $defaultstack $bmode $opt $testdata/testinput23 testtry
+      $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput23 testtry
       checkresult $? 23 ""
     fi
   fi