/[pcre]/code/trunk/RunTest
ViewVC logotype

Diff of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 689 by ph10, Fri Sep 9 10:34:57 2011 UTC revision 842 by ph10, Sat Dec 31 15:19:04 2011 UTC
# Line 18  Line 18 
18  # two tests for JIT-specific features, one to be run when JIT support is  # two tests for JIT-specific features, one to be run when JIT support is
19  # available, and one when it is not.  # available, and one when it is not.
20    
21  # The arguments for this script can be individual test numbers, or the word  # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
22  # "valgrind", or "sim" followed by an argument to run cross-compiled  # possible to select which to test by the arguments -8 or -16.
23    
24    # Other arguments for this script can be individual test numbers, or the word
25    # "valgrind", or "sim" followed by an argument to run cross-compiled
26  # executables under a simulator, for example:  # executables under a simulator, for example:
27  #  #
28  # RunTest 3 sim "qemu-arm -s 8388608"  # RunTest 3 sim "qemu-arm -s 8388608"
29    
30  valgrind=  valgrind=
31  sim=  sim=
32    arg8=
33    arg16=
34    
35    # This is in case the caller has set aliases (as I do - PH)
36    unset cp ls mv rm
37    
38  # Select which tests to run; for those that are explicitly requested, check  # Select which tests to run; for those that are explicitly requested, check
39  # that the necessary optional facilities are available.  # that the necessary optional facilities are available.
# Line 45  do12=no Line 53  do12=no
53  do13=no  do13=no
54  do14=no  do14=no
55  do15=no  do15=no
56    do16=no
57    do17=no
58    do18=no
59    do19=no
60    do20=no
61    
62  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
63    case $1 in    case $1 in
# Line 63  while [ $# -gt 0 ] ; do Line 76  while [ $# -gt 0 ] ; do
76     13) do13=yes;;     13) do13=yes;;
77     14) do14=yes;;     14) do14=yes;;
78     15) do15=yes;;     15) do15=yes;;
79       16) do16=yes;;
80       17) do17=yes;;
81       18) do18=yes;;
82       19) do19=yes;;
83       20) do20=yes;;
84       -8) arg8=yes;;
85      -16) arg16=yes;;
86     valgrind) valgrind="valgrind -q --smc-check=all";;     valgrind) valgrind="valgrind -q --smc-check=all";;
87     sim) shift; sim=$1;;     sim) shift; sim=$1;;
88      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number $1"; exit 1;;
# Line 77  if diff -u /dev/null /dev/null; then cf= Line 97  if diff -u /dev/null /dev/null; then cf=
97    
98  # Find the test data  # Find the test data
99    
 testdata=testdata  
100  if [ -n "$srcdir" -a -d "$srcdir" ] ; then  if [ -n "$srcdir" -a -d "$srcdir" ] ; then
101    testdata="$srcdir/testdata"    testdata="$srcdir/testdata"
102    elif [ -d "./testdata" ] ; then
103      testdata=./testdata
104    elif [ -d "../testdata" ] ; then
105      testdata=../testdata
106    else
107      echo "Cannot find the testdata directory"
108      exit 1
109  fi  fi
110    
111  # Find which optional facilities are available  # Find which optional facilities are available. In some Windows environments
112    # the output of pcretest -C has CRLF at the end of each line, but the shell
113    # strips only linefeeds from the output of a `backquoted` command. Hence the
114    # alternative patterns.
115    
116    $sim ./pcretest -C linksize >/dev/null
117    link_size=$?
118    if [ $link_size -lt 2 ] ; then
119      echo "Failed to find internal link size"
120      exit 1
121    fi
122    if [ $link_size -gt 4 ] ; then
123      echo "Failed to find internal link size"
124      exit 1
125    fi
126    
127    # Both 8-bit and 16-bit character strings may be supported, but only one
128    # need be.
129    
130    $sim ./pcretest -C pcre8 >/dev/null
131    support8=$?
132    $sim ./pcretest -C pcre16 >/dev/null
133    support16=$?
134    if [ $(( $support8 + $support16 )) -eq 2 ] ; then
135      test8=
136      test16=-16
137      if [ "$arg8" = yes -a "$arg16" != yes ] ; then
138        test16=skip
139      fi
140      if [ "$arg16" = yes -a "$arg8" != yes ] ; then
141        test8=skip
142      fi
143    else
144      if [ $support8 -ne 0 ] ; then
145        if [ "$arg16" = yes ] ; then
146          echo "Cannot run 16-bit library tests: 16-bit library not compiled"
147          exit 1
148        fi
149        test8=
150        test16=skip
151      else
152        if [ "$arg8" = yes ] ; then
153          echo "Cannot run 8-bit library tests: 8-bit library not compiled"
154          exit 1
155        fi
156        test8=skip
157        test16=-16
158      fi
159    fi
160    
161  case `$sim ./pcretest -C | $sim ./pcregrep 'Internal link size'` in  # UTF support always applies to both bit sizes if both are supported; we can't
162    *2) link_size=2;;  # have UTF-8 support without UTF-16 support (for example).
   *3) link_size=3;;  
   *4) link_size=4;;  
    *) echo "Failed to find internal link size"; exit 1;;  
 esac  
163    
164  $sim ./pcretest -C | $sim ./pcregrep 'No UTF-8 support' >/dev/null  $sim ./pcretest -C utf >/dev/null
165  utf8=$?  utf=$?
166    
167  $sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null  $sim ./pcretest -C ucp >/dev/null
168  ucp=$?  ucp=$?
169    
170  jitopt=  jitopt=
171  $sim ./pcretest -C | $sim ./pcregrep 'No just-in-time compiler support' \  $sim ./pcretest -C jit >/dev/null
   >/dev/null  
172  jit=$?  jit=$?
173  if [ $jit -ne 0 ] ; then  if [ $jit -ne 0 ] ; then
174    jitopt=-s+    jitopt=-s+
175  fi  fi
176    
177  if [ $utf8 -eq 0 ] ; then  if [ $utf -eq 0 ] ; then
178    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
179      echo "Can't run test 4 because UTF-8 support is not configured"      echo "Can't run test 4 because UTF support is not configured"
180      exit 1      exit 1
181    fi    fi
182    if [ $do5 = yes ] ; then    if [ $do5 = yes ] ; then
183      echo "Can't run test 5 because UTF-8 support is not configured"      echo "Can't run test 5 because UTF support is not configured"
184      exit 1      exit 1
185    fi    fi
186    if [ $do8 = yes ] ; then    if [ $do9 = yes ] ; then
187      echo "Can't run test 8 because UTF-8 support is not configured"      echo "Can't run test 8 because UTF support is not configured"
188      exit 1      exit 1
189    fi    fi
190    if [ $do12 = yes ] ; then    if [ $do15 = yes ] ; then
191      echo "Can't run test 12 because UTF-8 support is not configured"      echo "Can't run test 15 because UTF support is not configured"
192      exit 1      exit 1
193    fi    fi
194      if [ $do18 = yes ] ; then
195        echo "Can't run test 18 because UTF support is not configured"
196      fi
197  fi  fi
198    
199  if [ $ucp -eq 0 ] ; then  if [ $ucp -eq 0 ] ; then
# Line 129  if [ $ucp -eq 0 ] ; then Line 201  if [ $ucp -eq 0 ] ; then
201      echo "Can't run test 6 because Unicode property support is not configured"      echo "Can't run test 6 because Unicode property support is not configured"
202      exit 1      exit 1
203    fi    fi
204    if [ $do9 = yes ] ; then    if [ $do7 = yes ] ; then
205      echo "Can't run test 9 because Unicode property support is not configured"      echo "Can't run test 7 because Unicode property support is not configured"
206      exit 1      exit 1
207    fi    fi
208    if [ $do10 = yes ] ; then    if [ $do10 = yes ] ; then
209      echo "Can't run test 10 because Unicode property support is not configured"      echo "Can't run test 10 because Unicode property support is not configured"
210      exit 1      exit 1
211    fi    fi
212    if [ $do13 = yes ] ; then    if [ $do16 = yes ] ; then
213      echo "Can't run test 12 because Unicode property support is not configured"      echo "Can't run test 16 because Unicode property support is not configured"
214        exit 1
215      fi
216      if [ $do19 = yes ] ; then
217        echo "Can't run test 19 because Unicode property support is not configured"
218      exit 1      exit 1
219    fi    fi
220  fi  fi
221    
222  if [ $link_size -ne 2 ] ; then  if [ $link_size -ne 2 ] ; then
223    if [ $do10 = yes ] ; then    if [ $do11 = yes ] ; then
224      echo "Can't run test 10 because the link size ($link_size) is not 2"      echo "Can't run test 11 because the link size ($link_size) is not 2"
225      exit 1      exit 1
226    fi    fi
227  fi  fi
228    
229  if [ $jit -eq 0 ] ; then  if [ $jit -eq 0 ] ; then
230    if [ $do14 = "yes" ] ; then    if [ $do12 = "yes" ] ; then
231      echo "Can't run test 14 because JIT support is not configured"      echo "Can't run test 12 because JIT support is not configured"
232      exit 1      exit 1
233    fi    fi
234  else  else
235    if [ $do15 = "yes" ] ; then    if [ $do13 = "yes" ] ; then
236      echo "Can't run test 15 because JIT support is configured"      echo "Can't run test 13 because JIT support is configured"
237      exit 1      exit 1
238    fi    fi
239  fi  fi
# Line 168  fi Line 244  fi
244  if [ $do1  = no -a $do2  = no -a $do3  = no -a $do4  = no -a \  if [ $do1  = no -a $do2  = no -a $do3  = no -a $do4  = no -a \
245       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \
246       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
247       $do13 = no -a $do14 = no -a $do15 = no ] ; then       $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
248         $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no ] ; then
249    do1=yes    do1=yes
250    do2=yes    do2=yes
251    do3=yes    do3=yes
# Line 184  if [ $do1  = no -a $do2  = no -a $do3  = Line 261  if [ $do1  = no -a $do2  = no -a $do3  =
261    do13=yes    do13=yes
262    do14=yes    do14=yes
263    do15=yes    do15=yes
264      do16=yes
265      do17=yes
266      do18=yes
267      do19=yes
268      do20=yes
269  fi  fi
270    
271  # Show which release  # Show which release and which test data
272    
273  echo ""  echo ""
274  echo PCRE C library tests  echo PCRE C library tests using test data from $testdata
275  ./pcretest /dev/null  $sim ./pcretest /dev/null
276    
277    for bmode in "$test8" "$test16"; do
278      case "$bmode" in
279        skip) continue;;
280        -16)  if [ "$test8" != "skip" ] ; then echo ""; fi
281              bits=16; echo "---- Testing 16-bit library ----"; echo "";;
282        *)    bits=8; echo "---- Testing 8-bit library ----"; echo "";;
283      esac
284    
285  # Primary test, compatible with JIT and all versions of Perl >= 5.8  # Primary test, compatible with JIT and all versions of Perl >= 5.8
286    
287  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
288    echo "Test 1: main functionality (Compatible with Perl >= 5.8)"    echo "Test 1: main functionality (Compatible with Perl >= 5.10)"
289    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
290      $sim $valgrind ./pcretest -q $opt $testdata/testinput1 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
291      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
292        $cf $testdata/testoutput1 testtry        $cf $testdata/testoutput1 testtry
293        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 213  fi Line 303  fi
303  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
304    
305  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
306    echo "Test 2: API, errors, internals, and non-Perl stuff"    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)"
307    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
308      $sim $valgrind ./pcretest -q $opt $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
309      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
310        $cf $testdata/testoutput2 testtry        $cf $testdata/testoutput2 testtry
311        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 237  fi Line 327  fi
327    
328  # Locale-specific tests, provided that either the "fr_FR" or the "french"  # Locale-specific tests, provided that either the "fr_FR" or the "french"
329  # locale is available. The former is the Unix-like standard; the latter is  # locale is available. The former is the Unix-like standard; the latter is
330  # for Windows.  # for Windows. Another possibility is "fr", which needs to be run against
331    # the Windows-specific input and output files.
332    
333  if [ $do3 = yes ] ; then  if [ $do3 = yes ] ; then
334    locale -a | grep '^fr_FR$' >/dev/null    locale -a | grep '^fr_FR$' >/dev/null
# Line 246  if [ $do3 = yes ] ; then Line 337  if [ $do3 = yes ] ; then
337      infile=$testdata/testinput3      infile=$testdata/testinput3
338      outfile=$testdata/testoutput3      outfile=$testdata/testoutput3
339    else    else
340        infile=test3input
341        outfile=test3output
342      locale -a | grep '^french$' >/dev/null      locale -a | grep '^french$' >/dev/null
343      if [ $? -eq 0 ] ; then      if [ $? -eq 0 ] ; then
344        locale=french        locale=french
345        sed 's/fr_FR/french/' $testdata/testinput3 >test3input        sed 's/fr_FR/french/' $testdata/testinput3 >test3input
346        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
       infile=test3input  
       outfile=test3output  
347      else      else
348        locale=        locale -a | grep '^fr$' >/dev/null
349          if [ $? -eq 0 ] ; then
350            locale=fr
351            sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
352            sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
353          else
354            locale=
355          fi
356      fi      fi
357    fi    fi
358    
359    if [ "$locale" != "" ] ; then    if [ "$locale" != "" ] ; then
360      echo "Test 3: locale-specific features (using '$locale' locale)"      echo "Test 3: locale-specific features (using '$locale' locale)"
361      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
362        $sim $valgrind ./pcretest -q $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
363        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
364          $cf $outfile testtry          $cf $outfile testtry
365          if [ $? != 0 ] ; then          if [ $? != 0 ] ; then
# Line 280  if [ $do3 = yes ] ; then Line 378  if [ $do3 = yes ] ; then
378        fi        fi
379      done      done
380    else    else
381      echo "Cannot test locale-specific features - neither the 'fr_FR' nor the"      echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or"
382      echo "'french' locale exists, or the \"locale\" command is not available"      echo "'french' locales exist, or the \"locale\" command is not available"
383      echo "to check for them."      echo "to check for them."
384      echo " "      echo " "
385    fi    fi
386  fi  fi
387    
388  # Additional tests for UTF8 support  # Additional tests for UTF support
389    
390  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
391    echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)"    echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.10)"
392    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
393      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
394    else    else
395      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
396        $sim $valgrind ./pcretest -q $opt $testdata/testinput4 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
397        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
398          $cf $testdata/testoutput4 testtry          $cf $testdata/testoutput4 testtry
399          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 310  if [ $do4 = yes ] ; then Line 408  if [ $do4 = yes ] ; then
408  fi  fi
409    
410  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
411    echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support"    echo "Test 5: API, internals, and non-Perl stuff for UTF-$bits support"
412    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
413      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
414    else    else
415      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
416        $sim $valgrind ./pcretest -q $opt $testdata/testinput5 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
417        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
418          $cf $testdata/testoutput5 testtry          $cf $testdata/testoutput5 testtry
419          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 331  fi Line 429  fi
429    
430  if [ $do6 = yes ] ; then  if [ $do6 = yes ] ; then
431    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"
432    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
433      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
434    else    else
435      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
436        $sim $valgrind ./pcretest -q $opt $testdata/testinput6 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
437        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
438          $cf $testdata/testoutput6 testtry          $cf $testdata/testoutput6 testtry
439          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 349  if [ $do6 = yes ] ; then Line 447  if [ $do6 = yes ] ; then
447    fi    fi
448  fi  fi
449    
450  # Tests for DFA matching support  # Test non-Perl-compatible Unicode property support
451    
452  if [ $do7 = yes ] ; then  if [ $do7 = yes ] ; then
453    echo "Test 7: DFA matching"    echo "Test 7: API, internals, and non-Perl stuff for Unicode property support"
454      if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
455        echo "  Skipped because Unicode property support is not available"
456      else
457        for opt in "" "-s" $jitopt; do
458          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
459          if [ $? = 0 ] ; then
460            $cf $testdata/testoutput7 testtry
461            if [ $? != 0 ] ; then exit 1; fi
462          else exit 1
463          fi
464          if [ "$opt" = "-s" ] ; then echo "  OK with study"
465          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
466          else echo "  OK"
467          fi
468        done
469      fi
470    fi
471    
472    # Tests for DFA matching support
473    
474    if [ $do8 = yes ] ; then
475      echo "Test 8: DFA matching main functionality"
476    for opt in "" "-s"; do    for opt in "" "-s"; do
477      $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
478      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
479        $cf $testdata/testoutput7 testtry        $cf $testdata/testoutput8 testtry
480        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
481      else exit 1      else exit 1
482      fi      fi
# Line 364  if [ $do7 = yes ] ; then Line 484  if [ $do7 = yes ] ; then
484    done    done
485  fi  fi
486    
487  if [ $do8 = yes ] ; then  if [ $do9 = yes ] ; then
488    echo "Test 8: DFA matching with UTF-8"    echo "Test 9: DFA matching with UTF-$bits"
489    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
490      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
491    else    else
492      for opt in "" "-s"; do      for opt in "" "-s"; do
493        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
494        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
495          $cf $testdata/testoutput8 testtry          $cf $testdata/testoutput9 testtry
496          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
497        else exit 1        else exit 1
498        fi        fi
# Line 381  if [ $do8 = yes ] ; then Line 501  if [ $do8 = yes ] ; then
501    fi    fi
502  fi  fi
503    
504  if [ $do9 = yes ] ; then  if [ $do10 = yes ] ; then
505    echo "Test 9: DFA matching with Unicode properties"    echo "Test 10: DFA matching with Unicode properties"
506    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
507      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
508    else    else
509      for opt in "" "-s"; do      for opt in "" "-s"; do
510        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
511        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
512          $cf $testdata/testoutput9 testtry          $cf $testdata/testoutput10 testtry
513          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
514        else exit 1        else exit 1
515        fi        fi
# Line 402  fi Line 522  fi
522  # is Unicode property support and the link size is 2. The actual tests are  # is Unicode property support and the link size is 2. The actual tests are
523  # mostly the same as in some of the above, but in this test we inspect some  # mostly the same as in some of the above, but in this test we inspect some
524  # offsets and sizes that require a known link size. This is a doublecheck for  # offsets and sizes that require a known link size. This is a doublecheck for
525  # the maintainer, just in case something changes unexpectely.  # the maintainer, just in case something changes unexpectely. The output from
526    # this test is not the same in 8-bit and 16-bit modes.
527    
528  if [ $do10 = yes ] ; then  if [ $do11 = yes ] ; then
529    echo "Test 10: Internal offsets and code size tests"    echo "Test 11: Internal offsets and code size tests"
530    if [ $link_size -ne 2 ] ; then    if [ $link_size -ne 2 ] ; then
531      echo "  Skipped because link size is not 2"      echo "  Skipped because link size is not 2"
532    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
533      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
534    else    else
535      for opt in "" "-s"; do      for opt in "" "-s"; do
536        $sim $valgrind ./pcretest -q $opt $testdata/testinput10 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
537        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
538          $cf $testdata/testoutput10 testtry          $cf $testdata/testoutput11-$bits testtry
539          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
540        else exit 1        else exit 1
541        fi        fi
# Line 423  if [ $do10 = yes ] ; then Line 544  if [ $do10 = yes ] ; then
544    fi    fi
545  fi  fi
546    
547  # Test of Perl >= 5.10 features without UTF8 support  # Test JIT-specific features when JIT is available
548    
549  if [ $do11 = yes ] ; then  if [ $do12 = yes ] ; then
550    echo "Test 11: Features from Perl >= 5.10 without UTF8 support"    echo "Test 12: JIT-specific features (JIT available)"
551    for opt in "" "-s" $jitopt; do    if [ $jit -eq 0 ] ; then
552      $sim $valgrind ./pcretest -q $opt $testdata/testinput11 testtry      echo "  Skipped because JIT is not available or not usable"
553      else
554        $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
555      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
556        $cf $testdata/testoutput11 testtry        $cf $testdata/testoutput12 testtry
557        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
558      else exit 1      else exit 1
559      fi      fi
560      if [ "$opt" = "-s" ] ; then echo "  OK with study"      echo "  OK"
561      elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"    fi
562      else echo "  OK"  fi
563    
564    # Test JIT-specific features when JIT is not available
565    
566    if [ $do13 = yes ] ; then
567      echo "Test 13: JIT-specific features (JIT not available)"
568      if [ $jit -ne 0 ] ; then
569        echo "  Skipped because JIT is available"
570      else
571        $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
572        if [ $? = 0 ] ; then
573          $cf $testdata/testoutput13 testtry
574          if [ $? != 0 ] ; then exit 1; fi
575        else exit 1
576      fi      fi
577    done      echo "  OK"
578      fi
579  fi  fi
580    
581  # Test of Perl >= 5.10 features with UTF8 support  # Tests for 8-bit-specific features
582    
583  if [ $do12 = yes ] ; then  if [ "$do14" = yes ] ; then
584    echo "Test 12: Features from Perl >= 5.10 with UTF8 support"    echo "Test 14: specials for the basic 8-bit library"
585    if [ $utf8 -eq 0 ] ; then    if [ "$bits" = "16" ] ; then
586      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped when running 16-bit tests"
587    else    else
588        cp -f $testdata/saved16 testsaved16
589      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
590        $sim $valgrind ./pcretest -q $opt $testdata/testinput12 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
591        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
592          $cf $testdata/testoutput12 testtry          $cf $testdata/testoutput14 testtry
593          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
594        else exit 1        else exit 1
595        fi        fi
# Line 463  if [ $do12 = yes ] ; then Line 601  if [ $do12 = yes ] ; then
601    fi    fi
602  fi  fi
603    
604  # Test non-Perl-compatible Unicode property support  # Tests for 8-bit-specific features (needs UTF-8 support)
605    
606  if [ $do13 = yes ] ; then  if [ "$do15" = yes ] ; then
607    echo "Test 13: API, internals, and non-Perl stuff for Unicode property support"    echo "Test 15: specials for the 8-bit library with UTF-8 support"
608    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ "$bits" = "16" ] ; then
609        echo "  Skipped when running 16-bit tests"
610      elif [ $utf -eq 0 ] ; then
611        echo "  Skipped because UTF-$bits support is not available"
612      else
613        for opt in "" "-s" $jitopt; do
614          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
615          if [ $? = 0 ] ; then
616            $cf $testdata/testoutput15 testtry
617            if [ $? != 0 ] ; then exit 1; fi
618          else exit 1
619          fi
620          if [ "$opt" = "-s" ] ; then echo "  OK with study"
621          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
622          else echo "  OK"
623          fi
624        done
625      fi
626    fi
627    
628    # Tests for 8-bit-specific features (Unicode property support)
629    
630    if [ $do16 = yes ] ; then
631      echo "Test 16: specials for the 8-bit library with Unicode propery support"
632      if [ "$bits" = "16" ] ; then
633        echo "  Skipped when running 16-bit tests"
634      elif [ $ucp -eq 0 ] ; then
635      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
636    else    else
637      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
638        $sim $valgrind ./pcretest -q $opt $testdata/testinput13 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
639        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
640          $cf $testdata/testoutput13 testtry          $cf $testdata/testoutput16 testtry
641          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
642        else exit 1        else exit 1
643        fi        fi
# Line 485  if [ $do13 = yes ] ; then Line 649  if [ $do13 = yes ] ; then
649    fi    fi
650  fi  fi
651    
652  # Test JIT-specific features when JIT is available  # Tests for 16-bit-specific features
653    
654  if [ $do14 = yes ] ; then  if [ $do17 = yes ] ; then
655    echo "Test 14: JIT-specific features (JIT available)"    echo "Test 17: specials for the basic 16-bit library"
656    if [ $jit -eq 0 ] ; then    if [ "$bits" = "8" ] ; then
657      echo "  Skipped because JIT is not available or not usable"      echo "  Skipped when running 8-bit tests"
658      else
659        cp -f $testdata/saved8 testsaved8
660        cp -f $testdata/saved16LE-1 testsaved16LE-1
661        cp -f $testdata/saved16BE-1 testsaved16BE-1
662        for opt in "" "-s" $jitopt; do
663          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
664          if [ $? = 0 ] ; then
665            $cf $testdata/testoutput17 testtry
666            if [ $? != 0 ] ; then exit 1; fi
667          else exit 1
668          fi
669          if [ "$opt" = "-s" ] ; then echo "  OK with study"
670          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
671          else echo "  OK"
672          fi
673        done
674      fi
675    fi
676    
677    # Tests for 16-bit-specific features (UTF-16 support)
678    
679    if [ $do18 = yes ] ; then
680      echo "Test 18: specials for the 16-bit library with UTF-16 support"
681      if [ "$bits" = "8" ] ; then
682        echo "  Skipped when running 8-bit tests"
683      elif [ $utf -eq 0 ] ; then
684        echo "  Skipped because UTF-$bits support is not available"
685    else    else
686      $sim $valgrind ./pcretest -q $testdata/testinput14 testtry      cp -f $testdata/saved16LE-2 testsaved16LE-2
687      if [ $? = 0 ] ; then      cp -f $testdata/saved16BE-2 testsaved16BE-2
688        $cf $testdata/testoutput14 testtry      for opt in "" "-s" $jitopt; do
689        if [ $? != 0 ] ; then exit 1; fi        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
690      else exit 1        if [ $? = 0 ] ; then
691      fi          $cf $testdata/testoutput18 testtry
692      echo "  OK"          if [ $? != 0 ] ; then exit 1; fi
693          else exit 1
694          fi
695          if [ "$opt" = "-s" ] ; then echo "  OK with study"
696          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
697          else echo "  OK"
698          fi
699        done
700    fi    fi
701  fi  fi
702    
703  # Test JIT-specific features when JIT is not available  # Tests for 16-bit-specific features (Unicode property support)
704    
705  if [ $do15 = yes ] ; then  if [ $do19 = yes ] ; then
706    echo "Test 15: JIT-specific features (JIT not available)"    echo "Test 19: specials for the 16-bit library with Unicode propery support"
707    if [ $jit -ne 0 ] ; then    if [ "$bits" = "8" ] ; then
708      echo "  Skipped because JIT is available"      echo "  Skipped when running 8-bit tests"
709      elif [ $ucp -eq 0 ] ; then
710        echo "  Skipped because Unicode property support is not available"
711    else    else
712      $sim $valgrind ./pcretest -q $testdata/testinput15 testtry      for opt in "" "-s" $jitopt; do
713      if [ $? = 0 ] ; then        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
714        $cf $testdata/testoutput15 testtry        if [ $? = 0 ] ; then
715        if [ $? != 0 ] ; then exit 1; fi          $cf $testdata/testoutput19 testtry
716      else exit 1          if [ $? != 0 ] ; then exit 1; fi
717      fi        else exit 1
718      echo "  OK"        fi
719          if [ "$opt" = "-s" ] ; then echo "  OK with study"
720          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
721          else echo "  OK"
722          fi
723        done
724      fi
725    fi
726    
727    # Tests for 16-bit-specific features in DFA non-UTF-16 mode
728    
729    if [ $do20 = yes ] ; then
730      echo "Test 20: DFA specials for the basic 16-bit library"
731      if [ "$bits" = "8" ] ; then
732        echo "  Skipped when running 8-bit tests"
733      else
734        for opt in "" "-s"; do
735          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry
736          if [ $? = 0 ] ; then
737            $cf $testdata/testoutput20 testtry
738            if [ $? != 0 ] ; then exit 1; fi
739          else exit 1
740          fi
741          if [ "$opt" = "-s" ] ; then echo "  OK with study"
742          else echo "  OK"
743          fi
744        done
745    fi    fi
746  fi  fi
747    
748    # End of loop for 8-bit/16-bit tests
749    done
750    
751    # Clean up local working files
752    rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
753    
754  # End  # End

Legend:
Removed from v.689  
changed lines
  Added in v.842

  ViewVC Help
Powered by ViewVC 1.1.5