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

Diff of /code/trunk/RunTest

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

revision 559 by ph10, Wed Oct 27 09:45:20 2010 UTC revision 842 by ph10, Sat Dec 31 15:19:04 2011 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2    
3  # Run PCRE tests.  # Run the PCRE tests using the pcretest program. The appropriate tests are
4    # selected, depending on which build-time options were used.
5    
6  valgrind=  # 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
8  # Set up a suitable "diff" command for comparison. Some systems  # different output after studying, typically when we are tracing the actual
9  # have a diff that lacks a -u option. Try to deal with this.  # matching process (for example, using auto-callouts). In these few cases, the
10    # tests are duplicated in the files, one with /S to force studying always, and
11  if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi  # one with /SS to force *not* studying always. The use of -s doesn't then make
12    # any difference to their output. There is also one test which compiles invalid
13  # Find the test data  # UTF-8 with the UTF-8 check turned off; for this, studying must also be
14    # disabled with /SS.
15  testdata=testdata  
16  if [ -n "$srcdir" -a -d "$srcdir" ] ; then  # When JIT support is available, all the tests are also run with -s+ to test
17    testdata="$srcdir/testdata"  # (again, almost) everything with studying and the JIT option. There are also
18  fi  # two tests for JIT-specific features, one to be run when JIT support is
19    # available, and one when it is not.
20  # Find which optional facilities are available  
21    # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
22  case `./pcretest -C | ./pcregrep 'Internal link size'` in  # possible to select which to test by the arguments -8 or -16.
23    *2) link_size=2;;  
24    *3) link_size=3;;  # Other arguments for this script can be individual test numbers, or the word
25    *4) link_size=4;;  # "valgrind", or "sim" followed by an argument to run cross-compiled
26     *) echo "Failed to find internal link size"; exit 1;;  # executables under a simulator, for example:
27  esac  #
28    # RunTest 3 sim "qemu-arm -s 8388608"
29    
30  ./pcretest -C | ./pcregrep 'No UTF-8 support' >/dev/null  valgrind=
31  utf8=$?  sim=
32    arg8=
33    arg16=
34    
35  ./pcretest -C | ./pcregrep 'No Unicode properties support' >/dev/null  # This is in case the caller has set aliases (as I do - PH)
36  ucp=$?  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 46  do9=no Line 50  do9=no
50  do10=no  do10=no
51  do11=no  do11=no
52  do12=no  do12=no
53    do13=no
54    do14=no
55    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 61  while [ $# -gt 0 ] ; do Line 73  while [ $# -gt 0 ] ; do
73     10) do10=yes;;     10) do10=yes;;
74     11) do11=yes;;     11) do11=yes;;
75     12) do12=yes;;     12) do12=yes;;
76     valgrind) valgrind="valgrind -q";;     13) do13=yes;;
77       14) do14=yes;;
78       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";;
87       sim) shift; sim=$1;;
88      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number $1"; exit 1;;
89    esac    esac
90    shift    shift
91  done  done
92    
93  if [ $utf8 -eq 0 ] ; then  # Set up a suitable "diff" command for comparison. Some systems
94    # have a diff that lacks a -u option. Try to deal with this.
95    
96    if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi
97    
98    # Find the test data
99    
100    if [ -n "$srcdir" -a -d "$srcdir" ] ; then
101      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
110    
111    # 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    # UTF support always applies to both bit sizes if both are supported; we can't
162    # have UTF-8 support without UTF-16 support (for example).
163    
164    $sim ./pcretest -C utf >/dev/null
165    utf=$?
166    
167    $sim ./pcretest -C ucp >/dev/null
168    ucp=$?
169    
170    jitopt=
171    $sim ./pcretest -C jit >/dev/null
172    jit=$?
173    if [ $jit -ne 0 ] ; then
174      jitopt=-s+
175    fi
176    
177    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
185      fi
186      if [ $do9 = yes ] ; then
187        echo "Can't run test 8 because UTF support is not configured"
188      exit 1      exit 1
189    fi    fi
190    if [ $do8 = yes ] ; then    if [ $do15 = yes ] ; then
191      echo "Can't run test 8 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 87  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 [ $do12 = 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 no specific tests were requested, select all that are relevant.  if [ $jit -eq 0 ] ; then
230      if [ $do12 = "yes" ] ; then
231        echo "Can't run test 12 because JIT support is not configured"
232        exit 1
233      fi
234    else
235      if [ $do13 = "yes" ] ; then
236        echo "Can't run test 13 because JIT support is configured"
237        exit 1
238      fi
239    fi
240    
241    # If no specific tests were requested, select all. Those that are not
242    # relevant will be skipped.
243    
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 ] ; then       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
247         $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
252    if [ $utf8 -ne 0 ] ; then do4=yes; fi    do4=yes
253    if [ $utf8 -ne 0 ] ; then do5=yes; fi    do5=yes
254    if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do6=yes; fi    do6=yes
255    do7=yes    do7=yes
256    if [ $utf8 -ne 0 ] ; then do8=yes; fi    do8=yes
257    if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi    do9=yes
258    if [ $link_size -eq 2 -a $ucp -ne 0 ] ; then do10=yes; fi    do10=yes
259    do11=yes    do11=yes
260    if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do12=yes; fi    do12=yes
261      do13=yes
262      do14=yes
263      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  # Primary test, compatible with all versions of Perl >= 5.8  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
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    $valgrind ./pcretest -q $testdata/testinput1 testtry    for opt in "" "-s" $jitopt; do
290    if [ $? = 0 ] ; then      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
291      $cf $testdata/testoutput1 testtry      if [ $? = 0 ] ; then
292      if [ $? != 0 ] ; then exit 1; fi        $cf $testdata/testoutput1 testtry
293    else exit 1        if [ $? != 0 ] ; then exit 1; fi
294    fi      else exit 1
295    echo "OK"      fi
296        if [ "$opt" = "-s" ] ; then echo "  OK with study"
297        elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
298        else echo "  OK"
299        fi
300      done
301  fi  fi
302    
303  # PCRE tests that are not 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    $valgrind ./pcretest -q $testdata/testinput2 testtry    for opt in "" "-s" $jitopt; do
308    if [ $? = 0 ] ; then      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
309      $cf $testdata/testoutput2 testtry      if [ $? = 0 ] ; then
310      if [ $? != 0 ] ; then exit 1; fi        $cf $testdata/testoutput2 testtry
311    else        if [ $? != 0 ] ; then exit 1; fi
312      echo " "      else
313      echo "** Test 2 requires a lot of stack. If it has crashed with a"        echo " "
314      echo "** segmentation fault, it may be that you do not have enough"        echo "** Test 2 requires a lot of stack. If it has crashed with a"
315      echo "** stack available by default. Please see the 'pcrestack' man"        echo "** segmentation fault, it may be that you do not have enough"
316      echo "** page for a discussion of PCRE's stack usage."        echo "** stack available by default. Please see the 'pcrestack' man"
317      echo " "        echo "** page for a discussion of PCRE's stack usage."
318      exit 1        echo " "
319    fi        exit 1
320    echo "OK"      fi
321        if [ "$opt" = "-s" ] ; then echo "  OK with study"
322        elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
323        else echo "  OK"
324        fi
325      done
326  fi  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 177  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      $valgrind ./pcretest -q $infile testtry      for opt in "" "-s" $jitopt; do
362      if [ $? = 0 ] ; then        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
363        $cf $outfile testtry        if [ $? = 0 ] ; then
364        if [ $? != 0 ] ; then          $cf $outfile testtry
365          echo " "          if [ $? != 0 ] ; then
366          echo "Locale test did not run entirely successfully."            echo " "
367          echo "This usually means that there is a problem with the locale"            echo "Locale test did not run entirely successfully."
368          echo "settings rather than a bug in PCRE."            echo "This usually means that there is a problem with the locale"
369        else            echo "settings rather than a bug in PCRE."
370        echo "OK"            break;
371            else
372              if [ "$opt" = "-s" ] ; then echo "  OK with study"
373              elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
374              else echo "  OK"
375              fi
376            fi
377          else exit 1
378        fi        fi
379      else exit 1      done
     fi  
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    $valgrind ./pcretest -q $testdata/testinput4 testtry    if [ $utf -eq 0 ] ; then
393    if [ $? = 0 ] ; then      echo "  Skipped because UTF-$bits support is not available"
394      $cf $testdata/testoutput4 testtry    else
395      if [ $? != 0 ] ; then exit 1; fi      for opt in "" "-s" $jitopt; do
396    else exit 1        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
397          if [ $? = 0 ] ; then
398            $cf $testdata/testoutput4 testtry
399            if [ $? != 0 ] ; then exit 1; fi
400          else exit 1
401          fi
402          if [ "$opt" = "-s" ] ; then echo "  OK with study"
403          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
404          else echo "  OK"
405          fi
406        done
407    fi    fi
   echo "OK"  
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    $valgrind ./pcretest -q $testdata/testinput5 testtry    if [ $utf -eq 0 ] ; then
413    if [ $? = 0 ] ; then      echo "  Skipped because UTF-$bits support is not available"
414      $cf $testdata/testoutput5 testtry    else
415      if [ $? != 0 ] ; then exit 1; fi      for opt in "" "-s" $jitopt; do
416    else exit 1        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
417          if [ $? = 0 ] ; then
418            $cf $testdata/testoutput5 testtry
419            if [ $? != 0 ] ; then exit 1; fi
420          else exit 1
421          fi
422          if [ "$opt" = "-s" ] ; then echo "  OK with study"
423          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
424          else echo "  OK"
425          fi
426        done
427    fi    fi
   echo "OK"  
428  fi  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    $valgrind ./pcretest -q $testdata/testinput6 testtry    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
433    if [ $? = 0 ] ; then      echo "  Skipped because Unicode property support is not available"
434      $cf $testdata/testoutput6 testtry    else
435      if [ $? != 0 ] ; then exit 1; fi      for opt in "" "-s" $jitopt; do
436    else exit 1        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
437          if [ $? = 0 ] ; then
438            $cf $testdata/testoutput6 testtry
439            if [ $? != 0 ] ; then exit 1; fi
440          else exit 1
441          fi
442          if [ "$opt" = "-s" ] ; then echo "  OK with study"
443          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
444          else echo "  OK"
445          fi
446        done
447    fi    fi
   echo "OK"  
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    $valgrind ./pcretest -q -dfa $testdata/testinput7 testtry    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
455    if [ $? = 0 ] ; then      echo "  Skipped because Unicode property support is not available"
456      $cf $testdata/testoutput7 testtry    else
457      if [ $? != 0 ] ; then exit 1; fi      for opt in "" "-s" $jitopt; do
458    else exit 1        $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    fi
   echo "OK"  
470  fi  fi
471    
472    # Tests for DFA matching support
473    
474  if [ $do8 = yes ] ; then  if [ $do8 = yes ] ; then
475    echo "Test 8: DFA matching with UTF-8"    echo "Test 8: DFA matching main functionality"
476    $valgrind ./pcretest -q -dfa $testdata/testinput8 testtry    for opt in "" "-s"; do
477    if [ $? = 0 ] ; then      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
478      $cf $testdata/testoutput8 testtry      if [ $? = 0 ] ; then
479      if [ $? != 0 ] ; then exit 1; fi        $cf $testdata/testoutput8 testtry
480    else exit 1        if [ $? != 0 ] ; then exit 1; fi
481    fi      else exit 1
482    echo "OK"      fi
483        if [ "$opt" = "-s" ] ; then echo "  OK with study" ; else echo "  OK"; fi
484      done
485  fi  fi
486    
487  if [ $do9 = yes ] ; then  if [ $do9 = yes ] ; then
488    echo "Test 9: DFA matching with Unicode properties"    echo "Test 9: DFA matching with UTF-$bits"
489    $valgrind ./pcretest -q -dfa $testdata/testinput9 testtry    if [ $utf -eq 0 ] ; then
490    if [ $? = 0 ] ; then      echo "  Skipped because UTF-$bits support is not available"
491      $cf $testdata/testoutput9 testtry    else
492      if [ $? != 0 ] ; then exit 1; fi      for opt in "" "-s"; do
493    else exit 1        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
494          if [ $? = 0 ] ; then
495            $cf $testdata/testoutput9 testtry
496            if [ $? != 0 ] ; then exit 1; fi
497          else exit 1
498          fi
499          if [ "$opt" = "-s" ] ; then echo "  OK with study" ; else echo "  OK"; fi
500        done
501      fi
502    fi
503    
504    if [ $do10 = yes ] ; then
505      echo "Test 10: DFA matching with Unicode properties"
506      if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
507        echo "  Skipped because Unicode property support is not available"
508      else
509        for opt in "" "-s"; do
510          $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
511          if [ $? = 0 ] ; then
512            $cf $testdata/testoutput10 testtry
513            if [ $? != 0 ] ; then exit 1; fi
514          else exit 1
515          fi
516          if [ "$opt" = "-s" ] ; then echo "  OK with study" ; else echo "  OK"; fi
517        done
518    fi    fi
   echo "OK"  
519  fi  fi
520    
521  # Test of internal offsets and code sizes. This test is run only when there  # Test of internal offsets and code sizes. This test is run only when there
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    $valgrind ./pcretest -q $testdata/testinput10 testtry    if [ $link_size -ne 2 ] ; then
531    if [ $? = 0 ] ; then      echo "  Skipped because link size is not 2"
532      $cf $testdata/testoutput10 testtry    elif [ $ucp -eq 0 ] ; then
533      if [ $? != 0 ] ; then exit 1; fi      echo "  Skipped because Unicode property support is not available"
534    else exit 1    else
535        for opt in "" "-s"; do
536          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
537          if [ $? = 0 ] ; then
538            $cf $testdata/testoutput11-$bits testtry
539            if [ $? != 0 ] ; then exit 1; fi
540          else exit 1
541          fi
542          if [ "$opt" = "-s" ] ; then echo "  OK with study" ; else echo "  OK"; fi
543        done
544    fi    fi
   echo "OK"  
545  fi  fi
546    
547  # Test of Perl >= 5.10 features  # 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"    echo "Test 12: JIT-specific features (JIT available)"
551    $valgrind ./pcretest -q $testdata/testinput11 testtry    if [ $jit -eq 0 ] ; then
552    if [ $? = 0 ] ; then      echo "  Skipped because JIT is not available or not usable"
553      $cf $testdata/testoutput11 testtry    else
554      if [ $? != 0 ] ; then exit 1; fi      $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
555    else exit 1      if [ $? = 0 ] ; then
556          $cf $testdata/testoutput12 testtry
557          if [ $? != 0 ] ; then exit 1; fi
558        else exit 1
559        fi
560        echo "  OK"
561    fi    fi
   echo "OK"  
562  fi  fi
563    
564  # Test non-Perl-compatible Unicode property support  # Test JIT-specific features when JIT is not available
565    
566  if [ $do12 = yes ] ; then  if [ $do13 = yes ] ; then
567    echo "Test 12: API, internals, and non-Perl stuff for Unicode property support"    echo "Test 13: JIT-specific features (JIT not available)"
568    $valgrind ./pcretest -q $testdata/testinput12 testtry    if [ $jit -ne 0 ] ; then
569    if [ $? = 0 ] ; then      echo "  Skipped because JIT is available"
570      $cf $testdata/testoutput12 testtry    else
571      if [ $? != 0 ] ; then exit 1; fi      $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
572    else exit 1      if [ $? = 0 ] ; then
573          $cf $testdata/testoutput13 testtry
574          if [ $? != 0 ] ; then exit 1; fi
575        else exit 1
576        fi
577        echo "  OK"
578      fi
579    fi
580    
581    # Tests for 8-bit-specific features
582    
583    if [ "$do14" = yes ] ; then
584      echo "Test 14: specials for the basic 8-bit library"
585      if [ "$bits" = "16" ] ; then
586        echo "  Skipped when running 16-bit tests"
587      else
588        cp -f $testdata/saved16 testsaved16
589        for opt in "" "-s" $jitopt; do
590          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
591          if [ $? = 0 ] ; then
592            $cf $testdata/testoutput14 testtry
593            if [ $? != 0 ] ; then exit 1; fi
594          else exit 1
595          fi
596          if [ "$opt" = "-s" ] ; then echo "  OK with study"
597          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
598          else echo "  OK"
599          fi
600        done
601      fi
602    fi
603    
604    # Tests for 8-bit-specific features (needs UTF-8 support)
605    
606    if [ "$do15" = yes ] ; then
607      echo "Test 15: specials for the 8-bit library with UTF-8 support"
608      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"
636      else
637        for opt in "" "-s" $jitopt; do
638          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
639          if [ $? = 0 ] ; then
640            $cf $testdata/testoutput16 testtry
641            if [ $? != 0 ] ; then exit 1; fi
642          else exit 1
643          fi
644          if [ "$opt" = "-s" ] ; then echo "  OK with study"
645          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
646          else echo "  OK"
647          fi
648        done
649      fi
650    fi
651    
652    # Tests for 16-bit-specific features
653    
654    if [ $do17 = yes ] ; then
655      echo "Test 17: specials for the basic 16-bit library"
656      if [ "$bits" = "8" ] ; then
657        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
686        cp -f $testdata/saved16LE-2 testsaved16LE-2
687        cp -f $testdata/saved16BE-2 testsaved16BE-2
688        for opt in "" "-s" $jitopt; do
689          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
690          if [ $? = 0 ] ; then
691            $cf $testdata/testoutput18 testtry
692            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
701    fi
702    
703    # Tests for 16-bit-specific features (Unicode property support)
704    
705    if [ $do19 = yes ] ; then
706      echo "Test 19: specials for the 16-bit library with Unicode propery support"
707      if [ "$bits" = "8" ] ; then
708        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
712        for opt in "" "-s" $jitopt; do
713          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
714          if [ $? = 0 ] ; then
715            $cf $testdata/testoutput19 testtry
716            if [ $? != 0 ] ; then exit 1; fi
717          else exit 1
718          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    fi
   echo "OK"  
725  fi  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
746    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.559  
changed lines
  Added in v.842

  ViewVC Help
Powered by ViewVC 1.1.5