"Fossies" - the Fresh Open Source Software Archive

Member "vfu-4.18/vslib/pcre2/pcre2-10.20/RunTest" (18 Jun 2015, 21539 Bytes) of package /linux/privat/vfu-4.18.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/sh
    2 
    3 ###############################################################################
    4 # Run the PCRE2 tests using the pcre2test program. The appropriate tests are
    5 # selected, depending on which build-time options were used.
    6 #
    7 # When JIT support is available, all appropriate tests are run with and without
    8 # JIT, unless "-nojit" is given on the command line. There are also two tests
    9 # for JIT-specific features, one to be run when JIT support is available
   10 # (unless "-nojit" is specified), and one when it is not.
   11 #
   12 # Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
   13 # possible to select which to test by giving "-8", "-16" or "-32" on the
   14 # command line.
   15 #
   16 # As well as "-nojit", "-8", "-16", and "-32", arguments for this script are
   17 # individual test numbers, ranges of tests such as 3-6 or 3- (meaning 3 to the
   18 # end), or a number preceded by ~ to exclude a test. For example, "3-15 ~10"
   19 # runs tests 3 to 15, excluding test 10, and just "~10" runs all the tests
   20 # except test 10. Whatever order the arguments are in, the tests are always run
   21 # in numerical order.
   22 #
   23 # Inappropriate tests are automatically skipped (with a comment to say so). For
   24 # example, if JIT support is not compiled, test 16 is skipped, whereas if JIT
   25 # support is compiled, test 15 is skipped.
   26 #
   27 # Other arguments can be one of the words "-valgrind", "-valgrind-log", or
   28 # "-sim" followed by an argument to run cross-compiled executables under a
   29 # simulator, for example:
   30 #
   31 # RunTest 3 -sim "qemu-arm -s 8388608"
   32 #
   33 # For backwards compatibility, -nojit, -valgrind, -valgrind-log, and -sim may
   34 # be given without the leading "-" character.
   35 #
   36 # There are two special cases where only one argument is allowed:
   37 #
   38 # If the first and only argument is "ebcdic", the script runs the special
   39 # EBCDIC test that can be useful for checking certain EBCDIC features, even
   40 # when run in an ASCII environment. PCRE2 must be built with EBCDIC support for
   41 # this test to be run.
   42 #
   43 # If the script is obeyed as "RunTest list", a list of available tests is
   44 # output, but none of them are run.
   45 ###############################################################################
   46 
   47 # Define test titles in variables so that they can be output as a list. Some
   48 # of them are modified (e.g. with -8 or -16) when used in the actual tests.
   49 
   50 title0="Test 0: Unchecked pcre2test argument tests (to improve coverage)"
   51 title1="Test 1: Main non-UTF, non-UCP functionality (compatible with Perl >= 5.10)"
   52 title2="Test 2: API, errors, internals, and non-Perl stuff"
   53 title3="Test 3: Locale-specific features"
   54 title4A="Test 4: UTF"
   55 title4B=" and Unicode property support (compatible with Perl >= 5.10)"
   56 title5A="Test 5: API, internals, and non-Perl stuff for UTF"
   57 title5B=" and UCP support"
   58 title6="Test 6: DFA matching main non-UTF, non-UCP functionality"
   59 title7A="Test 7: DFA matching with UTF"
   60 title7B=" and Unicode property support"
   61 title8="Test 8: Internal offsets and code size tests"
   62 title9="Test 9: Specials for the basic 8-bit library"
   63 title10="Test 10: Specials for the 8-bit library with UTF-8 and UCP support"
   64 title11="Test 11: Specials for the basic 16-bit and 32-bit libraries"
   65 title12="Test 12: Specials for the 16-bit and 32-bit libraries UTF and UCP support"
   66 title13="Test 13: DFA specials for the basic 16-bit and 32-bit libraries"
   67 title14="Test 14: Non-JIT limits and other non-JIT tests"
   68 title15="Test 15: JIT-specific features when JIT is not available"
   69 title16="Test 16: JIT-specific features when JIT is available"
   70 title17="Test 17: Tests of the POSIX interface, excluding UTF/UCP"
   71 title18="Test 18: Tests of the POSIX interface with UTF/UCP"
   72 title19="Test 19: Serialization tests"
   73 maxtest=18
   74 
   75 if [ $# -eq 1 -a "$1" = "list" ]; then
   76   echo $title0
   77   echo $title1
   78   echo $title2 "(not UTF or UCP)"
   79   echo $title3
   80   echo $title4A $title4B
   81   echo $title5A $title5B
   82   echo $title6
   83   echo $title7A $title7B
   84   echo $title8
   85   echo $title9
   86   echo $title10
   87   echo $title11
   88   echo $title12
   89   echo $title13
   90   echo $title14
   91   echo $title15
   92   echo $title16
   93   echo $title17
   94   echo $title18
   95   echo $title19
   96   exit 0
   97 fi
   98 
   99 # Set up a suitable "diff" command for comparison. Some systems
  100 # have a diff that lacks a -u option. Try to deal with this.
  101 
  102 cf="diff"
  103 diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
  104 
  105 # Find the test data
  106 
  107 if [ -n "$srcdir" -a -d "$srcdir" ] ; then
  108   testdata="$srcdir/testdata"
  109 elif [ -d "./testdata" ] ; then
  110   testdata=./testdata
  111 elif [ -d "../testdata" ] ; then
  112   testdata=../testdata
  113 else
  114   echo "Cannot find the testdata directory"
  115   exit 1
  116 fi
  117 
  118 
  119 # ------ Function to check results of a test -------
  120 
  121 # This function is called with three parameters:
  122 #
  123 #  $1 the value of $? after a call to pcre2test
  124 #  $2 the suffix of the output file to compare with
  125 #  $3 the $opt value (empty, -jit, or -dfa)
  126 #
  127 # Note: must define using name(), not "function name", for Solaris.
  128 
  129 checkresult()
  130   {
  131   if [ $1 -ne 0 ] ; then
  132     echo "** pcre2test failed - check testtry"
  133     exit 1
  134   fi
  135   case "$3" in
  136     -jit) with=" with JIT";;
  137     -dfa) with=" with DFA";;
  138     *)    with="";;
  139   esac
  140   $cf $testdata/testoutput$2 testtry
  141   if [ $? != 0 ] ; then
  142     echo ""
  143     echo "** Test $2 failed$with"
  144     exit 1
  145   fi
  146   echo "  OK$with"
  147   }
  148 
  149 
  150 # ------ Function to run and check a special pcre2test arguments test -------
  151 
  152 checkspecial()
  153   {
  154   $valgrind ./pcre2test $1 >>testtry
  155   if [ $? -ne 0 ] ; then
  156     echo "** pcre2test $1 failed - check testtry"
  157     exit 1
  158   fi
  159   }
  160 
  161 
  162 # ------ Special EBCDIC Test -------
  163 
  164 if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
  165   $valgrind ./pcre2test -C ebcdic >/dev/null
  166   ebcdic=$?
  167   if [ $ebcdic -ne 1 ] ; then
  168     echo "Cannot run EBCDIC tests: EBCDIC support not compiled"
  169     exit 1
  170   fi
  171   for opt in "" "-dfa"; do
  172     ./pcre2test -q $opt $testdata/testinputEBC >testtry
  173     checkresult $? EBC "$opt"
  174   done
  175 exit 0
  176 fi
  177 
  178 
  179 # ------ Normal Tests ------
  180 
  181 # Default values
  182 
  183 arg8=
  184 arg16=
  185 arg32=
  186 nojit=
  187 sim=
  188 skip=
  189 valgrind=
  190 
  191 # This is in case the caller has set aliases (as I do - PH)
  192 unset cp ls mv rm
  193 
  194 # Process options and select which tests to run; for those that are explicitly
  195 # requested, check that the necessary optional facilities are available.
  196 
  197 do0=no
  198 do1=no
  199 do2=no
  200 do3=no
  201 do4=no
  202 do5=no
  203 do6=no
  204 do7=no
  205 do8=no
  206 do9=no
  207 do10=no
  208 do11=no
  209 do12=no
  210 do13=no
  211 do14=no
  212 do15=no
  213 do16=no
  214 do17=no
  215 do18=no
  216 do19=no
  217 
  218 while [ $# -gt 0 ] ; do
  219   case $1 in
  220     0) do0=yes;;
  221     1) do1=yes;;
  222     2) do2=yes;;
  223     3) do3=yes;;
  224     4) do4=yes;;
  225     5) do5=yes;;
  226     6) do6=yes;;
  227     7) do7=yes;;
  228     8) do8=yes;;
  229     9) do9=yes;;
  230    10) do10=yes;;
  231    11) do11=yes;;
  232    12) do12=yes;;
  233    13) do13=yes;;
  234    14) do14=yes;;
  235    15) do15=yes;;
  236    16) do16=yes;;
  237    17) do17=yes;;
  238    18) do18=yes;;
  239    19) do19=yes;;
  240    -8) arg8=yes;;
  241   -16) arg16=yes;;
  242   -32) arg32=yes;;
  243    nojit|-nojit) nojit=yes;;
  244    sim|-sim) shift; sim=$1;;
  245    valgrind|-valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
  246    valgrind-log|-valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
  247    ~*)
  248      if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
  249        skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
  250      else
  251        echo "Unknown option or test selector '$1'"; exit 1
  252      fi
  253    ;;
  254    *-*)
  255      if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
  256        tf=`expr "$1" : '\([0-9]*\)'`
  257        tt=`expr "$1" : '.*-\([0-9]*\)'`
  258        if [ "$tt" = "" ] ; then tt=$maxtest; fi
  259        if expr \( "$tt" ">" "$maxtest" \) >/dev/null; then
  260          echo "Invalid test range '$1'"; exit 1
  261        fi
  262        while expr "$tf" "<=" "$tt" >/dev/null; do
  263          eval do${tf}=yes
  264          tf=`expr $tf + 1`
  265        done
  266      else
  267        echo "Invalid test range '$1'"; exit 1
  268      fi
  269    ;;
  270    *) echo "Unknown option or test selector '$1'"; exit 1;;
  271   esac
  272   shift
  273 done
  274 
  275 # Find which optional facilities are available.
  276 
  277 $sim ./pcre2test -C linksize >/dev/null
  278 link_size=$?
  279 if [ $link_size -lt 2 ] ; then
  280   echo "RunTest: Failed to find internal link size"
  281   exit 1
  282 fi
  283 if [ $link_size -gt 4 ] ; then
  284   echo "RunTest: Failed to find internal link size"
  285   exit 1
  286 fi
  287 
  288 # If it is possible to set the system stack size, arrange to set a value for
  289 # test 2, which needs more than the even the Linux default when PCRE2 has been
  290 # compiled with -fsanitize=address.
  291 
  292 $sim ./pcre2test -S 1 /dev/null /dev/null
  293 if [ $? -eq 0 ] ; then
  294   test2stack="-S 16"
  295 else
  296   test2stack=""
  297 fi
  298 
  299 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
  300 # one need be.
  301 
  302 $sim ./pcre2test -C pcre2-8 >/dev/null
  303 support8=$?
  304 $sim ./pcre2test -C pcre2-16 >/dev/null
  305 support16=$?
  306 $sim ./pcre2test -C pcre2-32 >/dev/null
  307 support32=$?
  308 
  309 # Initialize all bitsizes skipped
  310 
  311 test8=skip
  312 test16=skip
  313 test32=skip
  314 
  315 # If no bitsize arguments, select all that are available
  316 
  317 if [ "$arg8$arg16$arg32" = "" ] ; then
  318   if [ $support8 -ne 0 ] ; then
  319     test8=-8
  320   fi
  321   if [ $support16 -ne 0 ] ; then
  322     test16=-16
  323   fi
  324   if [ $support32 -ne 0 ] ; then
  325     test32=-32
  326   fi
  327 
  328 # Otherwise, select requested bit sizes
  329 
  330 else
  331   if [ "$arg8" = yes ] ; then
  332     if [ $support8 -eq 0 ] ; then
  333       echo "Cannot run 8-bit library tests: 8-bit library not compiled"
  334       exit 1
  335     fi
  336     test8=-8
  337   fi
  338   if [ "$arg16" = yes ] ; then
  339     if [ $support16 -eq 0 ] ; then
  340       echo "Cannot run 16-bit library tests: 16-bit library not compiled"
  341       exit 1
  342     fi
  343     test16=-16
  344   fi
  345   if [ "$arg32" = yes ] ; then
  346     if [ $support32 -eq 0 ] ; then
  347       echo "Cannot run 32-bit library tests: 32-bit library not compiled"
  348       exit 1
  349     fi
  350     test32=-32
  351   fi
  352 fi
  353 
  354 # UTF support is implied by Unicode support, and it always applies to all bit
  355 # sizes if both are supported; we can't have UTF-8 support without UTF-16 or
  356 # UTF-32 support.
  357 
  358 $sim ./pcre2test -C unicode >/dev/null
  359 utf=$?
  360 
  361 jitopt=
  362 $sim ./pcre2test -C jit >/dev/null
  363 jit=$?
  364 if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
  365   jitopt=-jit
  366 fi
  367 
  368 # If no specific tests were requested, select all. Those that are not
  369 # relevant will be automatically skipped.
  370 
  371 if [ $do0  = no -a $do1  = no -a $do2  = no -a $do3  = no -a \
  372      $do4  = no -a $do5  = no -a $do6  = no -a $do7  = no -a \
  373      $do8  = no -a $do9  = no -a $do10 = no -a $do11 = no -a \
  374      $do12 = no -a $do13 = no -a $do14 = no -a $do15 = no -a \
  375      $do16 = no -a $do17 = no -a $do18 = no -a $do19 = no \
  376    ]; then
  377   do0=yes
  378   do1=yes
  379   do2=yes
  380   do3=yes
  381   do4=yes
  382   do5=yes
  383   do6=yes
  384   do7=yes
  385   do8=yes
  386   do9=yes
  387   do10=yes
  388   do11=yes
  389   do12=yes
  390   do13=yes
  391   do14=yes
  392   do15=yes
  393   do16=yes
  394   do17=yes
  395   do18=yes
  396   do19=yes
  397 fi
  398 
  399 # Handle any explicit skips at this stage, so that an argument list may consist
  400 # only of explicit skips.
  401 
  402 for i in $skip; do eval do$i=no; done
  403 
  404 # Show which release and which test data
  405 
  406 echo ""
  407 echo PCRE2 C library tests using test data from $testdata
  408 $sim ./pcre2test /dev/null
  409 echo ""
  410 
  411 for bmode in "$test8" "$test16" "$test32"; do
  412   case "$bmode" in
  413     skip) continue;;
  414     -16)  if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
  415           bits=16; echo "---- Testing 16-bit library ----"; echo "";;
  416     -32)  if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
  417           bits=32; echo "---- Testing 32-bit library ----"; echo "";;
  418     -8)   bits=8; echo "---- Testing 8-bit library ----"; echo "";;
  419   esac
  420 
  421   # Test 0 is a special test. Its output is not checked, because it will
  422   # be different on different hardware and with different configurations.
  423   # Running this test just exercises the code.
  424 
  425   if [ $do0 = yes ] ; then
  426     echo $title0
  427     echo '/abc/jit,memory' >testSinput
  428     echo '   abc' >>testSinput
  429     echo '' >testtry
  430     checkspecial '-C'
  431     checkspecial '--help'
  432     checkspecial '-S 1 -t 10 testSinput'
  433     echo "  OK"
  434   fi
  435 
  436   # Primary non-UTF test, compatible with JIT and all versions of Perl >= 5.8
  437 
  438   if [ $do1 = yes ] ; then
  439     echo $title1
  440     for opt in "" $jitopt; do
  441       $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput1 testtry
  442       checkresult $? 1 "$opt"
  443     done
  444   fi
  445 
  446   # PCRE2 tests that are not Perl-compatible: API, errors, internals
  447 
  448   if [ $do2 = yes ] ; then
  449     echo $title2 "(excluding UTF-$bits)"
  450     for opt in "" $jitopt; do
  451       $sim $valgrind ./pcre2test -q $test2stack $bmode $opt $testdata/testinput2 testtry
  452       if [ $? = 0 ] ; then
  453         checkresult $? 2 "$opt"
  454       else
  455         echo " "
  456         echo "** Test 2 requires a lot of stack. If it has crashed with a"
  457         echo "** segmentation fault, it may be that you do not have enough"
  458         echo "** stack available by default. Please see the 'pcre2stack' man"
  459         echo "** page for a discussion of PCRE2's stack usage."
  460         echo " "
  461         exit 1
  462       fi
  463     done
  464   fi
  465 
  466   # Locale-specific tests, provided that either the "fr_FR", "fr_CA", "french"
  467   # or "fr" locale is available. The first two are Unix-like standards; the
  468   # last two are for Windows. Unfortunately, different versions of the French
  469   # locale give different outputs for some items. This test passes if the
  470   # output matches any one of the alternative output files.
  471 
  472   if [ $do3 = yes ] ; then
  473     locale=
  474 
  475     # In some environments locales that are listed by the "locale -a"
  476     # command do not seem to work with setlocale(). Therefore, we do
  477     # a preliminary test to see if pcre2test can set one before going
  478     # on to use it.
  479 
  480     for loc in 'fr_FR' 'french' 'fr' 'fr_CA'; do
  481       locale -a | grep "^$loc\$" >/dev/null
  482       if [ $? -eq 0 ] ; then
  483         echo "/a/locale=$loc" | \
  484           $sim $valgrind ./pcre2test -q $bmode | \
  485             grep "Failed to set locale" >/dev/null
  486         if [ $? -ne 0 ] ; then
  487           locale=$loc
  488           if [ "$locale" = "fr_FR" ] ; then
  489             infile=$testdata/testinput3
  490             outfile=$testdata/testoutput3
  491             outfile2=$testdata/testoutput3A
  492             outfile3=$testdata/testoutput3B
  493           else
  494             infile=test3input
  495             outfile=test3output
  496             outfile2=test3outputA
  497             outfile3=test3outputB
  498             sed "s/fr_FR/$loc/" $testdata/testinput3 >test3input
  499             sed "s/fr_FR/$loc/" $testdata/testoutput3 >test3output
  500             sed "s/fr_FR/$loc/" $testdata/testoutput3A >test3outputA
  501             sed "s/fr_FR/$loc/" $testdata/testoutput3B >test3outputB
  502           fi
  503           break
  504         fi
  505       fi
  506     done
  507 
  508     if [ "$locale" != "" ] ; then
  509       echo $title3 "(using '$locale' locale)"
  510       for opt in "" $jitopt; do
  511         $sim $valgrind ./pcre2test -q $bmode $opt $infile testtry
  512         if [ $? = 0 ] ; then
  513           case "$opt" in
  514             -jit) with=" with JIT";;
  515             *)    with="";;
  516           esac
  517           if $cf $outfile testtry >teststdout || \
  518              $cf $outfile2 testtry >teststdout || \
  519              $cf $outfile3 testtry >teststdout
  520           then
  521             echo "  OK$with"
  522           else
  523             echo "** Locale test did not run successfully$with. The output did not match"
  524             echo "   $outfile, $outfile2 or $outfile3."
  525             echo "   This may mean that there is a problem with the locale settings rather"
  526             echo "   than a bug in PCRE2."
  527             exit 1
  528           fi
  529         else exit 1
  530         fi
  531       done
  532     else
  533       echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr_CA',"
  534       echo "'fr' or 'french' locales can be set, or the \"locale\" command is"
  535       echo "not available to check for them."
  536       echo " "
  537     fi
  538   fi
  539 
  540   # Tests for UTF and Unicode property support
  541 
  542   if [ $do4 = yes ] ; then
  543     echo ${title4A}-${bits}${title4B}
  544     if [ $utf -eq 0 ] ; then
  545       echo "  Skipped because UTF-$bits support is not available"
  546     else
  547       for opt in "" $jitopt; do
  548         $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput4 testtry
  549         checkresult $? 4 "$opt"
  550       done
  551     fi
  552   fi
  553 
  554   if [ $do5 = yes ] ; then
  555     echo ${title5A}-${bits}$title5B
  556     if [ $utf -eq 0 ] ; then
  557       echo "  Skipped because UTF-$bits support is not available"
  558     else
  559       for opt in "" $jitopt; do
  560         $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput5 testtry
  561         checkresult $? 5 "$opt"
  562       done
  563     fi
  564   fi
  565 
  566   # Tests for DFA matching support
  567 
  568   if [ $do6 = yes ] ; then
  569     echo $title6
  570     $sim $valgrind ./pcre2test -q $bmode $testdata/testinput6 testtry
  571     checkresult $? 6 ""
  572   fi
  573 
  574   if [ $do7 = yes ] ; then
  575     echo ${title7A}-${bits}$title7B
  576     if [ $utf -eq 0 ] ; then
  577       echo "  Skipped because UTF-$bits support is not available"
  578     else
  579       $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput7 testtry
  580       checkresult $? 7 ""
  581     fi
  582   fi
  583 
  584   # Test of internal offsets and code sizes. This test is run only when there
  585   # is UTF/UCP support and the link size is 2. The actual tests are
  586   # mostly the same as in some of the above, but in this test we inspect some
  587   # offsets and sizes that require a known link size. This is a doublecheck for
  588   # the maintainer, just in case something changes unexpectely. The output from
  589   # this test is different in 8-bit, 16-bit, and 32-bit modes, so there are
  590   # mode-specific output files.
  591 
  592   if [ $do8 = yes ] ; then
  593     echo $title8
  594     if [ $link_size -ne 2 ] ; then
  595       echo "  Skipped because link size is not 2"
  596     elif [ $utf -eq 0 ] ; then
  597       echo "  Skipped because UTF-$bits support is not available"
  598     else
  599       $sim $valgrind ./pcre2test -q $bmode $testdata/testinput8 testtry
  600       checkresult $? 8-$bits ""
  601     fi
  602   fi
  603 
  604   # Tests for 8-bit-specific features
  605 
  606   if [ "$do9" = yes ] ; then
  607     echo $title9
  608     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
  609       echo "  Skipped when running 16/32-bit tests"
  610     else
  611       for opt in "" $jitopt; do
  612         $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput9 testtry
  613         checkresult $? 9 "$opt"
  614       done
  615     fi
  616   fi
  617 
  618   # Tests for UTF-8 and UCP 8-bit-specific features
  619 
  620   if [ "$do10" = yes ] ; then
  621     echo $title10
  622     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
  623       echo "  Skipped when running 16/32-bit tests"
  624     elif [ $utf -eq 0 ] ; then
  625       echo "  Skipped because UTF-$bits support is not available"
  626     else
  627       for opt in "" $jitopt; do
  628         $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput10 testtry
  629         checkresult $? 10 "$opt"
  630       done
  631     fi
  632   fi
  633 
  634   # Tests for 16-bit and 32-bit features. Output is different for the two widths.
  635 
  636   if [ $do11 = yes ] ; then
  637     echo $title11
  638     if [ "$bits" = "8" ] ; then
  639       echo "  Skipped when running 8-bit tests"
  640     else
  641       for opt in "" $jitopt; do
  642         $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput11 testtry
  643         checkresult $? 11-$bits "$opt"
  644       done
  645     fi
  646   fi
  647 
  648   # Tests for 16-bit and 32-bit features with UTF-16/32 and UCP support. Output
  649   # is different for the two widths.
  650 
  651   if [ $do12 = yes ] ; then
  652     echo $title12
  653     if [ "$bits" = "8" ] ; then
  654       echo "  Skipped when running 8-bit tests"
  655     elif [ $utf -eq 0 ] ; then
  656       echo "  Skipped because UTF-$bits support is not available"
  657     else
  658       for opt in "" $jitopt; do
  659         $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput12 testtry
  660         checkresult $? 12-$bits "$opt"
  661       done
  662     fi
  663   fi
  664 
  665   # Tests for 16/32-bit-specific features in DFA non-UTF modes
  666 
  667   if [ $do13 = yes ] ; then
  668     echo $title13
  669     if [ "$bits" = "8" ] ; then
  670       echo "  Skipped when running 8-bit tests"
  671     else
  672       $sim $valgrind ./pcre2test -q $bmode $testdata/testinput13 testtry
  673       checkresult $? 13 ""
  674     fi
  675   fi
  676 
  677   # Test non-JIT match and recursion limits
  678 
  679   if [ $do14 = yes ] ; then
  680     echo $title14
  681     $sim $valgrind ./pcre2test -q $bmode $testdata/testinput14 testtry
  682     checkresult $? 14 ""
  683   fi
  684 
  685   # Test JIT-specific features when JIT is not available
  686 
  687   if [ $do15 = yes ] ; then
  688     echo $title15
  689     if [ $jit -ne 0 ] ; then
  690       echo "  Skipped because JIT is available"
  691     else
  692       $sim $valgrind ./pcre2test -q $bmode $testdata/testinput15 testtry
  693       checkresult $? 15 ""
  694     fi
  695   fi
  696 
  697   # Test JIT-specific features when JIT is available
  698 
  699   if [ $do16 = yes ] ; then
  700     echo $title16
  701     if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
  702       echo "  Skipped because JIT is not available or nojit was specified"
  703     else
  704       $sim $valgrind ./pcre2test -q $bmode $testdata/testinput16 testtry
  705       checkresult $? 16 ""
  706     fi
  707   fi
  708 
  709   # Tests for the POSIX interface without UTF/UCP (8-bit only)
  710 
  711   if [ $do17 = yes ] ; then
  712     echo $title17
  713     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
  714       echo "  Skipped when running 16/32-bit tests"
  715     else
  716       $sim $valgrind ./pcre2test -q $bmode $testdata/testinput17 testtry
  717       checkresult $? 17 ""
  718     fi
  719   fi
  720 
  721   # Tests for the POSIX interface with UTF/UCP (8-bit only)
  722 
  723   if [ $do18 = yes ] ; then
  724     echo $title18
  725     if [ "$bits" = "16" -o "$bits" = "32" ] ; then
  726       echo "  Skipped when running 16/32-bit tests"
  727     elif [ $utf -eq 0 ] ; then
  728       echo "  Skipped because UTF-$bits support is not available"
  729     else
  730       $sim $valgrind ./pcre2test -q $bmode $testdata/testinput18 testtry
  731       checkresult $? 18 ""
  732     fi
  733   fi
  734 
  735   # Serialization tests
  736 
  737   if [ $do19 = yes ] ; then
  738     echo $title19
  739     $sim $valgrind ./pcre2test -q $bmode $testdata/testinput19 testtry
  740     checkresult $? 19 ""
  741   fi
  742 
  743 # End of loop for 8/16/32-bit tests
  744 done
  745 
  746 # Clean up local working files
  747 rm -f testSinput test3input testsaved1 testsaved2 test3output test3outputA test3outputB teststdout teststderr testtry
  748 
  749 # End