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

Diff of /code/trunk/RunTest

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

revision 691 by ph10, Sun Sep 11 14:31:21 2011 UTC revision 1173 by chpe, Wed Oct 24 18:14:10 2012 UTC
# Line 2  Line 2 
2    
3  # Run the PCRE tests using the pcretest program. The appropriate tests are  # Run the PCRE tests using the pcretest program. The appropriate tests are
4  # selected, depending on which build-time options were used.  # selected, depending on which build-time options were used.
5    #
6  # All tests are now run both with and without -s, to ensure that everything is  # All tests are now run both with and without -s, to ensure that everything is
7  # tested with and without studying. However, there are some tests that produce  # tested with and without studying. However, there are some tests that produce
8  # different output after studying, typically when we are tracing the actual  # different output after studying, typically when we are tracing the actual
# Line 12  Line 12 
12  # any difference to their output. There is also one test which compiles invalid  # any difference to their output. There is also one test which compiles invalid
13  # UTF-8 with the UTF-8 check turned off; for this, studying must also be  # UTF-8 with the UTF-8 check turned off; for this, studying must also be
14  # disabled with /SS.  # disabled with /SS.
15    #
16  # When JIT support is available, all the tests are also run with -s+ to test  # When JIT support is available, all the tests are also run with -s+ to test
17  # (again, almost) everything with studying and the JIT option. There are also  # (again, almost) everything with studying and the JIT option. There are also
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-, 16- and 32-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, -16 or -32.
23  # executables under a simulator, for example:  #
24    # Other arguments for this script can be individual test numbers, or the word
25    # "valgrind", "valgrind-log" or "sim" followed by an argument to run cross-
26    # compiled executables under a simulator, for example:
27  #  #
28  # RunTest 3 sim "qemu-arm -s 8388608"  # RunTest 3 sim "qemu-arm -s 8388608"
29    #
30    #
31    # There are two special cases where only one argument is allowed:
32    #
33    # If the first and only argument is "ebcdic", the script runs the special
34    # EBCDIC test that can be useful for checking certain EBCDIC features, even
35    # when run in an ASCII environment.
36    #
37    # If the script is obeyed as "RunTest list", a list of available tests is
38    # output, but none of them are run.
39    
40    
41    # Define test titles in variables so that they can be output as a list. Some
42    # of them are modified (e.g. with -8 or -16) when used in the actual tests.
43    
44    title1="Test 1: Main functionality (Compatible with Perl >= 5.10)"
45    title2="Test 2: API, errors, internals, and non-Perl stuff"
46    title3="Test 3: Locale-specific features"
47    title4A="Test 4: UTF"
48    title4B=" support (Compatible with Perl >= 5.10)"
49    title5="Test 5: API, internals, and non-Perl stuff for UTF"
50    title6="Test 6: Unicode property support (Compatible with Perl >= 5.10)"
51    title7="Test 7: API, internals, and non-Perl stuff for Unicode property support"
52    title8="Test 8: DFA matching main functionality"
53    title9="Test 9: DFA matching with UTF"
54    title10="Test 10: DFA matching with Unicode properties"
55    title11="Test 11: Internal offsets and code size tests"
56    title12="Test 12: JIT-specific features (JIT available)"
57    title13="Test 13: JIT-specific features (JIT not available)"
58    title14="Test 14: Specials for the basic 8-bit library"
59    title15="Test 15: Specials for the 8-bit library with UTF-8 support"
60    title16="Test 16: Specials for the 8-bit library with Unicode propery support"
61    title17="Test 17: Specials for the basic 16/32-bit library"
62    title18="Test 18: Specials for the 16/32-bit library with UTF-16/32 support"
63    title19="Test 19: Specials for the 16/32-bit library with Unicode property support"
64    title20="Test 20: DFA specials for the basic 16/32-bit library"
65    title21="Test 21: Reloads for the basic 16/32-bit library"
66    title22="Test 22: Reloads for the 16/32-bit library with UTF-16/32 support"
67    title23="Test 23: Specials for the 16-bit library"
68    title24="Test 24: Specials for the 16-bit library with UTF-16 support"
69    title25="Test 25: Specials for the 32-bit library"
70    title26="Test 26: Specials for the 32-bit library with UTF-32 support"
71    
72    if [ $# -eq 1 -a "$1" = "list" ]; then
73      echo $title1
74      echo $title2 "(not UTF)"
75      echo $title3
76      echo $title4A $title4B
77      echo $title5 support
78      echo $title6
79      echo $title7
80      echo $title8
81      echo $title9
82      echo $title10
83      echo $title11
84      echo $title12
85      echo $title13
86      echo $title14
87      echo $title15
88      echo $title16
89      echo $title17
90      echo $title18
91      echo $title19
92      echo $title20
93      echo $title21
94      echo $title22
95      echo $title23
96      echo $title24
97      echo $title25
98      echo $title26
99      exit 0
100    fi
101    
102    # Set up a suitable "diff" command for comparison. Some systems
103    # have a diff that lacks a -u option. Try to deal with this.
104    
105    cf="diff"
106    diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
107    
108    # Find the test data
109    
110    if [ -n "$srcdir" -a -d "$srcdir" ] ; then
111      testdata="$srcdir/testdata"
112    elif [ -d "./testdata" ] ; then
113      testdata=./testdata
114    elif [ -d "../testdata" ] ; then
115      testdata=../testdata
116    else
117      echo "Cannot find the testdata directory"
118      exit 1
119    fi
120    
121    
122    # ------ Special EBCDIC Test -------
123    
124    if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
125      ./pcretest -C ebcdic >/dev/null
126      ebcdic=$?
127      if [ $ebcdic -ne 1 ] ; then
128        echo "Cannot run EBCDIC tests: EBCDIC support not compiled"
129        exit 1
130      fi
131    
132      for opt in "" "-s" "-dfa" "-s -dfa"; do
133        ./pcretest -q $opt $testdata/testinputEBC >testtry
134        if [ $? = 0 ] ; then
135          $cf $testdata/testoutputEBC testtry
136          if [ $? != 0 ] ; then exit 1; fi
137        else exit 1
138        fi
139        if [ "$opt" = "-s" ] ; then echo "  OK with study"
140        elif [ "$opt" = "-dfa" ] ; then echo "  OK using DFA"
141        elif [ "$opt" = "-s -dfa" ] ; then echo "  OK using DFA with study"
142        else echo "  OK"
143        fi
144      done
145    
146    exit 0
147    fi
148    
149    
150    # ------ Normal Tests ------
151    
152    # Default values
153    
154  valgrind=  valgrind=
155  sim=  sim=
156    arg8=
157    arg16=
158    arg32=
159    
160    # This is in case the caller has set aliases (as I do - PH)
161    unset cp ls mv rm
162    
163  # Select which tests to run; for those that are explicitly requested, check  # Select which tests to run; for those that are explicitly requested, check
164  # that the necessary optional facilities are available.  # that the necessary optional facilities are available.
# Line 45  do12=no Line 178  do12=no
178  do13=no  do13=no
179  do14=no  do14=no
180  do15=no  do15=no
181    do16=no
182    do17=no
183    do18=no
184    do19=no
185    do20=no
186    do21=no
187    do22=no
188    do23=no
189    do24=no
190    do25=no
191    do26=no
192    
193  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
194    case $1 in    case $1 in
# Line 63  while [ $# -gt 0 ] ; do Line 207  while [ $# -gt 0 ] ; do
207     13) do13=yes;;     13) do13=yes;;
208     14) do14=yes;;     14) do14=yes;;
209     15) do15=yes;;     15) do15=yes;;
210     valgrind) valgrind="valgrind -q --smc-check=all";;     16) do16=yes;;
211       17) do17=yes;;
212       18) do18=yes;;
213       19) do19=yes;;
214       20) do20=yes;;
215       21) do21=yes;;
216       22) do22=yes;;
217       23) do23=yes;;
218       24) do24=yes;;
219       25) do25=yes;;
220       26) do26=yes;;
221       -8) arg8=yes;;
222      -16) arg16=yes;;
223      -32) arg32=yes;;
224       valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
225       valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
226     sim) shift; sim=$1;;     sim) shift; sim=$1;;
227      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number '$1'"; exit 1;;
228    esac    esac
229    shift    shift
230  done  done
231    
232  # Set up a suitable "diff" command for comparison. Some systems  # Find which optional facilities are available.
 # have a diff that lacks a -u option. Try to deal with this.  
233    
234  if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi  $sim ./pcretest -C linksize >/dev/null
235    link_size=$?
236    if [ $link_size -lt 2 ] ; then
237      echo "Failed to find internal link size"
238      exit 1
239    fi
240    if [ $link_size -gt 4 ] ; then
241      echo "Failed to find internal link size"
242      exit 1
243    fi
244    
245    # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
246    # one need be.
247    
248    $sim ./pcretest -C pcre8 >/dev/null
249    support8=$?
250    $sim ./pcretest -C pcre16 >/dev/null
251    support16=$?
252    $sim ./pcretest -C pcre32 >/dev/null
253    support32=$?
254    
255    # Initialize all bitsizes skipped
256    
257    test8=skip
258    test16=skip
259    test32=skip
260    
261    # If no bitsize arguments, select all that are available
262    
263    if [ "$arg8$arg16$arg32" = "" ] ; then
264      if [ $support8 -ne 0 ] ; then
265        test8=
266      fi
267      if [ $support16 -ne 0 ] ; then
268        test16=-16
269      fi
270      if [ $support32 -ne 0 ] ; then
271        test32=-32
272      fi
273    
274  # Find the test data  # Select requested bit sizes
275    
276  testdata=testdata  else
277  if [ -n "$srcdir" -a -d "$srcdir" ] ; then    if [ "$arg8" = yes ] ; then
278    testdata="$srcdir/testdata"      if [ $support8 -eq 0 ] ; then
279          echo "Cannot run 8-bit library tests: 8-bit library not compiled"
280          exit 1
281        fi
282        test8=
283      fi
284      if [ "$arg16" = yes ] ; then
285        if [ $support16 -eq 0 ] ; then
286          echo "Cannot run 16-bit library tests: 16-bit library not compiled"
287          exit 1
288        fi
289        test16=-16
290      fi
291      if [ "$arg32" = yes ] ; then
292        if [ $support32 -eq 0 ] ; then
293          echo "Cannot run 32-bit library tests: 32-bit library not compiled"
294          exit 1
295        fi
296        test32=-32
297      fi
298  fi  fi
299    
300  # Find which optional facilities are available  # UTF support always applies to all bit sizes if both are supported; we can't
301    # have UTF-8 support without UTF-16 support (for example).
 case `$sim ./pcretest -C | $sim ./pcregrep 'Internal link size'` in  
   *2) link_size=2;;  
   *3) link_size=3;;  
   *4) link_size=4;;  
    *) echo "Failed to find internal link size"; exit 1;;  
 esac  
302    
303  $sim ./pcretest -C | $sim ./pcregrep 'No UTF-8 support' >/dev/null  $sim ./pcretest -C utf >/dev/null
304  utf8=$?  utf=$?
305    
306  $sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null  $sim ./pcretest -C ucp >/dev/null
307  ucp=$?  ucp=$?
308    
309  jitopt=  jitopt=
310  $sim ./pcretest -C | $sim ./pcregrep 'No just-in-time compiler support' \  $sim ./pcretest -C jit >/dev/null
   >/dev/null  
311  jit=$?  jit=$?
312  if [ $jit -ne 0 ] ; then  if [ $jit -ne 0 ] ; then
313    jitopt=-s+    jitopt=-s+
314  fi  fi
315    
316  if [ $utf8 -eq 0 ] ; then  if [ $utf -eq 0 ] ; then
317    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
318      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"
319      exit 1      exit 1
320    fi    fi
321    if [ $do5 = yes ] ; then    if [ $do5 = yes ] ; then
322      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"
323      exit 1      exit 1
324    fi    fi
325    if [ $do8 = yes ] ; then    if [ $do9 = yes ] ; then
326      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"
327      exit 1      exit 1
328    fi    fi
329    if [ $do12 = yes ] ; then    if [ $do15 = yes ] ; then
330      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"
331      exit 1      exit 1
332    fi    fi
333      if [ $do18 = yes ] ; then
334        echo "Can't run test 18 because UTF support is not configured"
335      fi
336      if [ $do22 = yes ] ; then
337        echo "Can't run test 22 because UTF support is not configured"
338      fi
339  fi  fi
340    
341  if [ $ucp -eq 0 ] ; then  if [ $ucp -eq 0 ] ; then
# Line 129  if [ $ucp -eq 0 ] ; then Line 343  if [ $ucp -eq 0 ] ; then
343      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"
344      exit 1      exit 1
345    fi    fi
346    if [ $do9 = yes ] ; then    if [ $do7 = yes ] ; then
347      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"
348      exit 1      exit 1
349    fi    fi
350    if [ $do10 = yes ] ; then    if [ $do10 = yes ] ; then
351      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"
352      exit 1      exit 1
353    fi    fi
354    if [ $do13 = yes ] ; then    if [ $do16 = yes ] ; then
355      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"
356        exit 1
357      fi
358      if [ $do19 = yes ] ; then
359        echo "Can't run test 19 because Unicode property support is not configured"
360      exit 1      exit 1
361    fi    fi
362  fi  fi
363    
364  if [ $link_size -ne 2 ] ; then  if [ $link_size -ne 2 ] ; then
365    if [ $do10 = yes ] ; then    if [ $do11 = yes ] ; then
366      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"
367      exit 1      exit 1
368    fi    fi
369  fi  fi
370    
371  if [ $jit -eq 0 ] ; then  if [ $jit -eq 0 ] ; then
372    if [ $do14 = "yes" ] ; then    if [ $do12 = "yes" ] ; then
373      echo "Can't run test 14 because JIT support is not configured"      echo "Can't run test 12 because JIT support is not configured"
374      exit 1      exit 1
375    fi    fi
376  else  else
377    if [ $do15 = "yes" ] ; then    if [ $do13 = "yes" ] ; then
378      echo "Can't run test 15 because JIT support is configured"      echo "Can't run test 13 because JIT support is configured"
379      exit 1      exit 1
380    fi    fi
381  fi  fi
# Line 168  fi Line 386  fi
386  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 \
387       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \
388       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
389       $do13 = no -a $do14 = no -a $do15 = no ] ; then       $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
390         $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \
391         $do21 = no -a $do22 = no -a $do23 = no -a $do24 = no -a \
392         $do25 = no -a $do26 = no ] ; then
393    do1=yes    do1=yes
394    do2=yes    do2=yes
395    do3=yes    do3=yes
# Line 184  if [ $do1  = no -a $do2  = no -a $do3  = Line 405  if [ $do1  = no -a $do2  = no -a $do3  =
405    do13=yes    do13=yes
406    do14=yes    do14=yes
407    do15=yes    do15=yes
408      do16=yes
409      do17=yes
410      do18=yes
411      do19=yes
412      do20=yes
413      do21=yes
414      do22=yes
415      do23=yes
416      do24=yes
417      do25=yes
418      do26=yes
419    fi
420    
421    # Extra test round for testing 32-bit UTF mode with high bits set
422    if test "$test32" != "skip" -a $utf -eq 1; then
423      test32plus="-32+"
424    else
425      test32plus=skip
426  fi  fi
427    
428  # Show which release  # Show which release and which test data
429    
430  echo ""  echo ""
431  echo PCRE C library tests  echo PCRE C library tests using test data from $testdata
432  ./pcretest /dev/null  $sim ./pcretest /dev/null
433    
434    for bmode in "$test8" "$test16" "$test32" "$test32plus"; do
435      case "$bmode" in
436        skip) continue;;
437        -16)  if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
438              bits=16; echo "---- Testing 16-bit library ----"; echo "";;
439        -32)  if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
440              bits=32; echo "---- Testing 32-bit library ----"; echo "";;
441        -32+) echo ""
442              bits=32; echo "---- Testing 32-bit library UTF-32 mode with high bits set ----"; echo "";;
443        *)    bits=8; echo "---- Testing 8-bit library ----"; echo "";;
444      esac
445    
446      # When testing 32-bit UTF mode with high bits masked, skip all non-UTF tests
447      # Since this is the last test, we can just set doN=no
448      if test "$bmode" = "-32+"; then
449        do1=no do2=no do3=no do8=no
450        do12=no do13=no do14=no do15=no do16=no do17=no
451        do20=no do21=no do23=no do24=no do25=no
452      fi
453    
454  # Primary test, compatible with JIT and all versions of Perl >= 5.8  # Primary test, compatible with JIT and all versions of Perl >= 5.8
455    
456  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
457    echo "Test 1: main functionality (Compatible with Perl >= 5.8)"    echo $title1
458    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
459      $sim $valgrind ./pcretest -q $opt $testdata/testinput1 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
460      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
461        $cf $testdata/testoutput1 testtry        $cf $testdata/testoutput1 testtry
462        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 213  fi Line 472  fi
472  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
473    
474  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
475    echo "Test 2: API, errors, internals, and non-Perl stuff"    echo $title2 "(not UTF-$bits)"
476    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
477      $sim $valgrind ./pcretest -q $opt $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
478      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
479        $cf $testdata/testoutput2 testtry        $cf $testdata/testoutput2 testtry
480        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 237  fi Line 496  fi
496    
497  # Locale-specific tests, provided that either the "fr_FR" or the "french"  # Locale-specific tests, provided that either the "fr_FR" or the "french"
498  # 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
499  # for Windows.  # for Windows. Another possibility is "fr", which needs to be run against
500    # the Windows-specific input and output files.
501    
502  if [ $do3 = yes ] ; then  if [ $do3 = yes ] ; then
503    locale -a | grep '^fr_FR$' >/dev/null    locale -a | grep '^fr_FR$' >/dev/null
# Line 246  if [ $do3 = yes ] ; then Line 506  if [ $do3 = yes ] ; then
506      infile=$testdata/testinput3      infile=$testdata/testinput3
507      outfile=$testdata/testoutput3      outfile=$testdata/testoutput3
508    else    else
509        infile=test3input
510        outfile=test3output
511      locale -a | grep '^french$' >/dev/null      locale -a | grep '^french$' >/dev/null
512      if [ $? -eq 0 ] ; then      if [ $? -eq 0 ] ; then
513        locale=french        locale=french
514        sed 's/fr_FR/french/' $testdata/testinput3 >test3input        sed 's/fr_FR/french/' $testdata/testinput3 >test3input
515        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
       infile=test3input  
       outfile=test3output  
516      else      else
517        locale=        locale -a | grep '^fr$' >/dev/null
518          if [ $? -eq 0 ] ; then
519            locale=fr
520            sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
521            sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
522          else
523            locale=
524          fi
525      fi      fi
526    fi    fi
527    
528    if [ "$locale" != "" ] ; then    if [ "$locale" != "" ] ; then
529      echo "Test 3: locale-specific features (using '$locale' locale)"      echo $title3 "(using '$locale' locale)"
530      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
531        $sim $valgrind ./pcretest -q $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
532        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
533          $cf $outfile testtry          $cf $outfile testtry
534          if [ $? != 0 ] ; then          if [ $? != 0 ] ; then
# Line 280  if [ $do3 = yes ] ; then Line 547  if [ $do3 = yes ] ; then
547        fi        fi
548      done      done
549    else    else
550      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"
551      echo "'french' locale exists, or the \"locale\" command is not available"      echo "'french' locales exist, or the \"locale\" command is not available"
552      echo "to check for them."      echo "to check for them."
553      echo " "      echo " "
554    fi    fi
555  fi  fi
556    
557  # Additional tests for UTF8 support  # Additional tests for UTF support
558    
559  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
560    echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)"    echo ${title4A}-${bits}${title4B}
561    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
562      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
563    else    else
564      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
565        $sim $valgrind ./pcretest -q $opt $testdata/testinput4 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
566        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
567          $cf $testdata/testoutput4 testtry          $cf $testdata/testoutput4 testtry
568          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 310  if [ $do4 = yes ] ; then Line 577  if [ $do4 = yes ] ; then
577  fi  fi
578    
579  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
580    echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support"    echo ${title5}-${bits} support
581    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
582      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
583    else    else
584      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
585        $sim $valgrind ./pcretest -q $opt $testdata/testinput5 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
586        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
587          $cf $testdata/testoutput5 testtry          $cf $testdata/testoutput5 testtry
588          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 330  if [ $do5 = yes ] ; then Line 597  if [ $do5 = yes ] ; then
597  fi  fi
598    
599  if [ $do6 = yes ] ; then  if [ $do6 = yes ] ; then
600    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"    echo $title6
601    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
602      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
603    else    else
604      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
605        $sim $valgrind ./pcretest -q $opt $testdata/testinput6 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
606        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
607          $cf $testdata/testoutput6 testtry          $cf $testdata/testoutput6 testtry
608          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 349  if [ $do6 = yes ] ; then Line 616  if [ $do6 = yes ] ; then
616    fi    fi
617  fi  fi
618    
619  # Tests for DFA matching support  # Test non-Perl-compatible Unicode property support
620    
621  if [ $do7 = yes ] ; then  if [ $do7 = yes ] ; then
622    echo "Test 7: DFA matching"    echo $title7
623      if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
624        echo "  Skipped because Unicode property support is not available"
625      else
626        for opt in "" "-s" $jitopt; do
627          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
628          if [ $? = 0 ] ; then
629            $cf $testdata/testoutput7 testtry
630            if [ $? != 0 ] ; then exit 1; fi
631          else exit 1
632          fi
633          if [ "$opt" = "-s" ] ; then echo "  OK with study"
634          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
635          else echo "  OK"
636          fi
637        done
638      fi
639    fi
640    
641    # Tests for DFA matching support
642    
643    if [ $do8 = yes ] ; then
644      echo $title8
645    for opt in "" "-s"; do    for opt in "" "-s"; do
646      $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
647      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
648        $cf $testdata/testoutput7 testtry        $cf $testdata/testoutput8 testtry
649        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
650      else exit 1      else exit 1
651      fi      fi
# Line 364  if [ $do7 = yes ] ; then Line 653  if [ $do7 = yes ] ; then
653    done    done
654  fi  fi
655    
656  if [ $do8 = yes ] ; then  if [ $do9 = yes ] ; then
657    echo "Test 8: DFA matching with UTF-8"    echo ${title9}-${bits}
658    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
659      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
660    else    else
661      for opt in "" "-s"; do      for opt in "" "-s"; do
662        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
663        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
664          $cf $testdata/testoutput8 testtry          $cf $testdata/testoutput9 testtry
665          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
666        else exit 1        else exit 1
667        fi        fi
# Line 381  if [ $do8 = yes ] ; then Line 670  if [ $do8 = yes ] ; then
670    fi    fi
671  fi  fi
672    
673  if [ $do9 = yes ] ; then  if [ $do10 = yes ] ; then
674    echo "Test 9: DFA matching with Unicode properties"    echo $title10
675    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
676      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
677    else    else
678      for opt in "" "-s"; do      for opt in "" "-s"; do
679        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
680        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
681          $cf $testdata/testoutput9 testtry          $cf $testdata/testoutput10 testtry
682          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
683        else exit 1        else exit 1
684        fi        fi
# Line 402  fi Line 691  fi
691  # 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
692  # 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
693  # 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
694  # the maintainer, just in case something changes unexpectely.  # the maintainer, just in case something changes unexpectely. The output from
695    # this test is not the same in 8-bit and 16-bit modes.
696    
697  if [ $do10 = yes ] ; then  if [ $do11 = yes ] ; then
698    echo "Test 10: Internal offsets and code size tests"    echo $title11
699    if [ $link_size -ne 2 ] ; then    if [ $link_size -ne 2 ] ; then
700      echo "  Skipped because link size is not 2"      echo "  Skipped because link size is not 2"
701    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
702      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
703    else    else
704      for opt in "" "-s"; do      for opt in "" "-s"; do
705        $sim $valgrind ./pcretest -q $opt $testdata/testinput10 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
706        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
707          $cf $testdata/testoutput10 testtry          $cf $testdata/testoutput11-$bits testtry
708          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
709        else exit 1        else exit 1
710        fi        fi
# Line 423  if [ $do10 = yes ] ; then Line 713  if [ $do10 = yes ] ; then
713    fi    fi
714  fi  fi
715    
716  # Test of Perl >= 5.10 features without UTF8 support  # Test JIT-specific features when JIT is available
717    
718  if [ $do11 = yes ] ; then  if [ $do12 = yes ] ; then
719    echo "Test 11: Features from Perl >= 5.10 without UTF8 support"    echo $title12
720    for opt in "" "-s" $jitopt; do    if [ $jit -eq 0 ] ; then
721      $sim $valgrind ./pcretest -q $opt $testdata/testinput11 testtry      echo "  Skipped because JIT is not available or not usable"
722      else
723        $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
724      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
725        $cf $testdata/testoutput11 testtry        $cf $testdata/testoutput12 testtry
726        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
727      else exit 1      else exit 1
728      fi      fi
729      if [ "$opt" = "-s" ] ; then echo "  OK with study"      echo "  OK"
730      elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"    fi
731      else echo "  OK"  fi
732    
733    # Test JIT-specific features when JIT is not available
734    
735    if [ $do13 = yes ] ; then
736      echo $title13
737      if [ $jit -ne 0 ] ; then
738        echo "  Skipped because JIT is available"
739      else
740        $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
741        if [ $? = 0 ] ; then
742          $cf $testdata/testoutput13 testtry
743          if [ $? != 0 ] ; then exit 1; fi
744        else exit 1
745      fi      fi
746    done      echo "  OK"
747      fi
748  fi  fi
749    
750  # Test of Perl >= 5.10 features with UTF8 support  # Tests for 8-bit-specific features
751    
752  if [ $do12 = yes ] ; then  if [ "$do14" = yes ] ; then
753    echo "Test 12: Features from Perl >= 5.10 with UTF8 support"    echo $title14
754    if [ $utf8 -eq 0 ] ; then    if [ "$bits" = "16" -o "$bits" = "32" ] ; then
755      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped when running 16/32-bit tests"
756    else    else
757        cp -f $testdata/saved16 testsaved16
758        cp -f $testdata/saved32 testsaved32
759      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
760        $sim $valgrind ./pcretest -q $opt $testdata/testinput12 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
761        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
762          $cf $testdata/testoutput12 testtry          $cf $testdata/testoutput14 testtry
763          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
764        else exit 1        else exit 1
765        fi        fi
# Line 463  if [ $do12 = yes ] ; then Line 771  if [ $do12 = yes ] ; then
771    fi    fi
772  fi  fi
773    
774  # Test non-Perl-compatible Unicode property support  # Tests for 8-bit-specific features (needs UTF-8 support)
775    
776  if [ $do13 = yes ] ; then  if [ "$do15" = yes ] ; then
777    echo "Test 13: API, internals, and non-Perl stuff for Unicode property support"    echo $title15
778    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ "$bits" = "16" -o "$bits" = "32" ] ; then
779        echo "  Skipped when running 16/32-bit tests"
780      elif [ $utf -eq 0 ] ; then
781        echo "  Skipped because UTF-$bits support is not available"
782      else
783        for opt in "" "-s" $jitopt; do
784          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
785          if [ $? = 0 ] ; then
786            $cf $testdata/testoutput15 testtry
787            if [ $? != 0 ] ; then exit 1; fi
788          else exit 1
789          fi
790          if [ "$opt" = "-s" ] ; then echo "  OK with study"
791          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
792          else echo "  OK"
793          fi
794        done
795      fi
796    fi
797    
798    # Tests for 8-bit-specific features (Unicode property support)
799    
800    if [ $do16 = yes ] ; then
801      echo $title16
802      if [ "$bits" = "16" -o "$bits" = "32" ] ; then
803        echo "  Skipped when running 16/32-bit tests"
804      elif [ $ucp -eq 0 ] ; then
805      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
806    else    else
807      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
808        $sim $valgrind ./pcretest -q $opt $testdata/testinput13 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
809        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
810          $cf $testdata/testoutput13 testtry          $cf $testdata/testoutput16 testtry
811          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
812        else exit 1        else exit 1
813        fi        fi
# Line 485  if [ $do13 = yes ] ; then Line 819  if [ $do13 = yes ] ; then
819    fi    fi
820  fi  fi
821    
822  # Test JIT-specific features when JIT is available  # Tests for 16/32-bit-specific features
823    
824  if [ $do14 = yes ] ; then  if [ $do17 = yes ] ; then
825    echo "Test 14: JIT-specific features (JIT available)"    echo $title17
826    if [ $jit -eq 0 ] ; then    if [ "$bits" = "8" ] ; then
827      echo "  Skipped because JIT is not available or not usable"      echo "  Skipped when running 8-bit tests"
828      else
829        for opt in "" "-s" $jitopt; do
830          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
831          if [ $? = 0 ] ; then
832            $cf $testdata/testoutput17 testtry
833            if [ $? != 0 ] ; then exit 1; fi
834          else exit 1
835          fi
836          if [ "$opt" = "-s" ] ; then echo "  OK with study"
837          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
838          else echo "  OK"
839          fi
840        done
841      fi
842    fi
843    
844    # Tests for 16/32-bit-specific features (UTF-16/32 support)
845    
846    if [ $do18 = yes ] ; then
847      echo $title18
848      if [ "$bits" = "8" ] ; then
849        echo "  Skipped when running 8-bit tests"
850      elif [ $utf -eq 0 ] ; then
851        echo "  Skipped because UTF-$bits support is not available"
852      else
853        for opt in "" "-s" $jitopt; do
854          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
855          if [ $? = 0 ] ; then
856            $cf $testdata/testoutput18-$bits testtry
857            if [ $? != 0 ] ; then exit 1; fi
858          else exit 1
859          fi
860          if [ "$opt" = "-s" ] ; then echo "  OK with study"
861          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
862          else echo "  OK"
863          fi
864        done
865      fi
866    fi
867    
868    # Tests for 16/32-bit-specific features (Unicode property support)
869    
870    if [ $do19 = yes ] ; then
871      echo $title19
872      if [ "$bits" = "8" ] ; then
873        echo "  Skipped when running 8-bit tests"
874      elif [ $ucp -eq 0 ] ; then
875        echo "  Skipped because Unicode property support is not available"
876    else    else
877      $sim $valgrind ./pcretest -q $testdata/testinput14 testtry      for opt in "" "-s" $jitopt; do
878          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
879          if [ $? = 0 ] ; then
880            $cf $testdata/testoutput19 testtry
881            if [ $? != 0 ] ; then exit 1; fi
882          else exit 1
883          fi
884          if [ "$opt" = "-s" ] ; then echo "  OK with study"
885          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
886          else echo "  OK"
887          fi
888        done
889      fi
890    fi
891    
892    # Tests for 16/32-bit-specific features in DFA non-UTF-16 mode
893    
894    if [ $do20 = yes ] ; then
895      echo $title20
896      if [ "$bits" = "8" ] ; then
897        echo "  Skipped when running 8-bit tests"
898      else
899        for opt in "" "-s"; do
900          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry
901          if [ $? = 0 ] ; then
902            $cf $testdata/testoutput20 testtry
903            if [ $? != 0 ] ; then exit 1; fi
904          else exit 1
905          fi
906          if [ "$opt" = "-s" ] ; then echo "  OK with study"
907          else echo "  OK"
908          fi
909        done
910      fi
911    fi
912    
913    # Tests for reloads with 16/32-bit library
914    
915    if [ $do21 = yes ] ; then
916      echo $title21
917      if [ "$bits" = "8" ] ; then
918        echo "  Skipped when running 8-bit tests"
919      elif [ $link_size -ne 2 ] ; then
920        echo "  Skipped because link size is not 2"
921      else
922        cp -f $testdata/saved8 testsaved8
923        cp -f $testdata/saved16LE-1 testsaved16LE-1
924        cp -f $testdata/saved16BE-1 testsaved16BE-1
925        cp -f $testdata/saved32LE-1 testsaved32LE-1
926        cp -f $testdata/saved32BE-1 testsaved32BE-1
927        $sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry
928      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
929        $cf $testdata/testoutput14 testtry        $cf $testdata/testoutput21-$bits testtry
930        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
931      else exit 1      else exit 1
932      fi      fi
# Line 502  if [ $do14 = yes ] ; then Line 934  if [ $do14 = yes ] ; then
934    fi    fi
935  fi  fi
936    
937  # Test JIT-specific features when JIT is not available  # Tests for reloads with 16/32-bit library (UTF-16 support)
938    
939  if [ $do15 = yes ] ; then  if [ $do22 = yes ] ; then
940    echo "Test 15: JIT-specific features (JIT not available)"    echo $title22
941    if [ $jit -ne 0 ] ; then    if [ "$bits" = "8" ] ; then
942      echo "  Skipped because JIT is available"      echo "  Skipped when running 8-bit tests"
943      elif [ $utf -eq 0 ] ; then
944        echo "  Skipped because UTF-$bits support is not available"
945      elif [ $link_size -ne 2 ] ; then
946        echo "  Skipped because link size is not 2"
947    else    else
948      $sim $valgrind ./pcretest -q $testdata/testinput15 testtry      cp -f $testdata/saved16LE-2 testsaved16LE-2
949        cp -f $testdata/saved16BE-2 testsaved16BE-2
950        cp -f $testdata/saved32LE-2 testsaved32LE-2
951        cp -f $testdata/saved32BE-2 testsaved32BE-2
952        $sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry
953      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
954        $cf $testdata/testoutput15 testtry        $cf $testdata/testoutput22-$bits testtry
955        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
956      else exit 1      else exit 1
957      fi      fi
# Line 519  if [ $do15 = yes ] ; then Line 959  if [ $do15 = yes ] ; then
959    fi    fi
960  fi  fi
961    
962    if [ $do23 = yes ] ; then
963      echo $title23
964      if [ "$bits" = "8" -o "$bits" = "32" ] ; then
965        echo "  Skipped when running 8/32-bit tests"
966      else
967        $sim $valgrind ./pcretest -q $bmode $testdata/testinput23 testtry
968        if [ $? = 0 ] ; then
969          $cf $testdata/testoutput23 testtry
970          if [ $? != 0 ] ; then exit 1; fi
971        else exit 1
972        fi
973        echo "  OK"
974      fi
975    fi
976    
977    if [ $do24 = yes ] ; then
978      echo $title24
979      if [ "$bits" = "8" -o "$bits" = "32" ] ; then
980        echo "  Skipped when running 8/32-bit tests"
981      elif [ $utf -eq 0 ] ; then
982        echo "  Skipped because UTF-$bits support is not available"
983      else
984        $sim $valgrind ./pcretest -q $bmode $testdata/testinput24 testtry
985        if [ $? = 0 ] ; then
986          $cf $testdata/testoutput24 testtry
987          if [ $? != 0 ] ; then exit 1; fi
988        else exit 1
989        fi
990        echo "  OK"
991      fi
992    fi
993    
994    if [ $do25 = yes ] ; then
995      echo $title25
996      if [ "$bits" = "8" -o "$bits" = "16" ] ; then
997        echo "  Skipped when running 8/16-bit tests"
998      else
999        $sim $valgrind ./pcretest -q $bmode $testdata/testinput25 testtry
1000        if [ $? = 0 ] ; then
1001          $cf $testdata/testoutput25 testtry
1002          if [ $? != 0 ] ; then exit 1; fi
1003        else exit 1
1004        fi
1005        echo "  OK"
1006      fi
1007    fi
1008    
1009    if [ $do26 = yes ] ; then
1010      echo $title26
1011      if [ "$bits" = "8" -o "$bits" = "16" ] ; then
1012        echo "  Skipped when running 8/16-bit tests"
1013      elif [ $utf -eq 0 ] ; then
1014        echo "  Skipped because UTF-$bits support is not available"
1015      else
1016        $sim $valgrind ./pcretest -q $bmode $testdata/testinput26 testtry
1017        if [ $? = 0 ] ; then
1018          $cf $testdata/testoutput26 testtry
1019          if [ $? != 0 ] ; then exit 1; fi
1020        else exit 1
1021        fi
1022        echo "  OK"
1023      fi
1024    fi
1025    
1026    # End of loop for 8/16/32-bit tests
1027    done
1028    
1029    # Clean up local working files
1030    rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
1031    
1032  # End  # End

Legend:
Removed from v.691  
changed lines
  Added in v.1173

  ViewVC Help
Powered by ViewVC 1.1.5