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

Diff of /code/trunk/RunTest

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

code/trunk/RunTest.in revision 81 by nigel, Sat Feb 24 21:40:59 2007 UTC code/trunk/RunTest revision 842 by ph10, Sat Dec 31 15:19:04 2011 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2    
3  # This file is generated by configure from RunTest.in. Make any changes  # Run the PCRE tests using the pcretest program. The appropriate tests are
4  # to that file.  # selected, depending on which build-time options were used.
5    
6  # Run PCRE tests  # 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    # different output after studying, typically when we are tracing the actual
9    # 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    # 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    # UTF-8 with the UTF-8 check turned off; for this, studying must also be
14    # disabled with /SS.
15    
16    # 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
18    # two tests for JIT-specific features, one to be run when JIT support is
19    # available, and one when it is not.
20    
21    # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
22    # 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:
27    #
28    # RunTest 3 sim "qemu-arm -s 8388608"
29    
30    valgrind=
31    sim=
32    arg8=
33    arg16=
34    
35  cf=diff  # This is in case the caller has set aliases (as I do - PH)
36  if [ ! -d testdata ] ; then  unset cp ls mv rm
   ln -s @top_srcdir@/testdata testdata  
 fi  
 testdata=./testdata  
37    
38  # Select which tests to run; if no selection, run all  # Select which tests to run; for those that are explicitly requested, check
39    # that the necessary optional facilities are available.
40    
41  do1=no  do1=no
42  do2=no  do2=no
# Line 22  do6=no Line 47  do6=no
47  do7=no  do7=no
48  do8=no  do8=no
49  do9=no  do9=no
50    do10=no
51    do11=no
52    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 34  while [ $# -gt 0 ] ; do Line 70  while [ $# -gt 0 ] ; do
70      7) do7=yes;;      7) do7=yes;;
71      8) do8=yes;;      8) do8=yes;;
72      9) do9=yes;;      9) do9=yes;;
73       10) do10=yes;;
74       11) do11=yes;;
75       12) do12=yes;;
76       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 [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then  # Set up a suitable "diff" command for comparison. Some systems
94    if [ $do2 = yes ] ; then  # have a diff that lacks a -u option. Try to deal with this.
95      echo "Can't run test 2 with an internal link size other than 2"  
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
179        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 with an internal link size other than 2"      echo "Can't run test 5 because UTF support is not configured"
184      exit 1      exit 1
185    fi    fi
186    if [ $do6 = yes ] ; then    if [ $do9 = yes ] ; then
187      echo "Can't run test 6 with an internal link size other than 2"      echo "Can't run test 8 because UTF support is not configured"
188        exit 1
189      fi
190      if [ $do15 = yes ] ; then
191        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 [ "@UTF8@" = "" ] ; then  if [ $ucp -eq 0 ] ; then
200    if [ $do4 = yes ] ; then    if [ $do6 = yes ] ; then
201      echo "Can't run test 4 because UTF-8 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 [ $do5 = yes ] ; then    if [ $do7 = yes ] ; then
205      echo "Can't run test 5 because UTF-8 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 [ $do6 = yes ] ; then    if [ $do10 = yes ] ; then
209      echo "Can't run test 6 because UTF-8 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 [ $do8 = yes ] ; then    if [ $do16 = yes ] ; then
213      echo "Can't run test 8 because UTF-8 support is not configured"      echo "Can't run test 16 because Unicode property support is not configured"
214      exit 1      exit 1
215    fi    fi
216    if [ $do9 = yes ] ; then    if [ $do19 = yes ] ; then
217      echo "Can't run test 9 because UTF-8 support is not configured"      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 [ "@UCP@" = "" ] ; then  if [ $link_size -ne 2 ] ; then
223    if [ $do6 = yes ] ; then    if [ $do11 = yes ] ; then
224      echo "Can't run test 6 because Unicode property support is not configured"      echo "Can't run test 11 because the link size ($link_size) is not 2"
225      exit 1      exit 1
226    fi    fi
227    if [ $do9 = yes ] ; then  fi
228      echo "Can't run test 9 because Unicode property support is not configured"  
229    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      exit 1
238    fi    fi
239  fi  fi
240    
241  if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \  # If no specific tests were requested, select all. Those that are not
242       $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \  # relevant will be skipped.
243       $do9 = no ] ; then  
244    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 \
246         $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@" != "" ] ; then do4=yes; fi    do4=yes
253    if [ "@UTF8@" != "" ] ; then do5=yes; fi    do5=yes
254    if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi    do6=yes
255    do7=yes    do7=yes
256    if [ "@UTF8@" != "" ] ; then do8=yes; fi    do8=yes
257    if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi    do9=yes
258  fi    do10=yes
259      do11=yes
260  # Show which release    do12=yes
261      do13=yes
262  ./pcretest /dev/null    do14=yes
263      do15=yes
264      do16=yes
265      do17=yes
266      do18=yes
267      do19=yes
268      do20=yes
269    fi
270    
271    # Show which release and which test data
272    
273    echo ""
274    echo PCRE C library tests using test data from $testdata
275    $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, Perl-compatible  # 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 (Perl compatible)"    echo "Test 1: main functionality (Compatible with Perl >= 5.10)"
289    ./pcretest $testdata/testinput1 testtry    for opt in "" "-s" $jitopt; do
290    if [ $? = 0 ] ; then      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
291      $cf testtry $testdata/testoutput1      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    echo " "      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 & error tests, mostly  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
304    
305  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
306    if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)"
307      echo "Test 2: API and error handling (not Perl compatible)"    for opt in "" "-s" $jitopt; do
308      ./pcretest -i $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
309      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
310        $cf testtry $testdata/testoutput2        $cf $testdata/testoutput2 testtry
311        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
312      else exit 1      else
313          echo " "
314          echo "** Test 2 requires a lot of stack. If it has crashed with a"
315          echo "** segmentation fault, it may be that you do not have enough"
316          echo "** stack available by default. Please see the 'pcrestack' man"
317          echo "** page for a discussion of PCRE's stack usage."
318          echo " "
319          exit 1
320      fi      fi
321      echo "OK"      if [ "$opt" = "-s" ] ; then echo "  OK with study"
322      echo " "      elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
323    else      else echo "  OK"
324      echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\)      fi
325      echo " "    done
   fi  
326  fi  fi
327    
328  # Locale-specific tests, provided the "fr_FR" locale is available  # 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
330    # 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
335    if [ $? -eq 0 ] ; then    if [ $? -eq 0 ] ; then
336      echo "Test 3: locale-specific features (using 'fr_FR' locale)"      locale=fr_FR
337      ./pcretest $testdata/testinput3 testtry      infile=$testdata/testinput3
338      if [ $? = 0 ] ; then      outfile=$testdata/testoutput3
339        $cf testtry $testdata/testoutput3    else
340        if [ $? != 0 ] ; then      infile=test3input
341          echo " "      outfile=test3output
342          echo "Locale test did not run entirely successfully."      locale -a | grep '^french$' >/dev/null
343          echo "This usually means that there is a problem with the locale"      if [ $? -eq 0 ] ; then
344          echo "settings rather than a bug in PCRE."        locale=french
345          sed 's/fr_FR/french/' $testdata/testinput3 >test3input
346          sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
347        else
348          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        else
354        echo "OK"          locale=
355        fi        fi
       echo " "  
     else exit 1  
356      fi      fi
357      fi
358    
359      if [ "$locale" != "" ] ; then
360        echo "Test 3: locale-specific features (using '$locale' locale)"
361        for opt in "" "-s" $jitopt; do
362          $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
363          if [ $? = 0 ] ; then
364            $cf $outfile testtry
365            if [ $? != 0 ] ; then
366              echo " "
367              echo "Locale test did not run entirely successfully."
368              echo "This usually means that there is a problem with the locale"
369              echo "settings rather than a bug in PCRE."
370              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
379        done
380    else    else
381      echo "Cannot test locale-specific features - 'fr_FR' locale not found,"      echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or"
382      echo "or the \"locale\" command is not available to check for it."      echo "'french' locales exist, or the \"locale\" command is not available"
383        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 (Perl compatible)"    echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.10)"
392    ./pcretest $testdata/testinput4 testtry    if [ $utf -eq 0 ] ; then
393    if [ $? = 0 ] ; then      echo "  Skipped because UTF-$bits support is not available"
394      $cf testtry $testdata/testoutput4    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"  
   echo " "  
408  fi  fi
409    
410  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
411    if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then    echo "Test 5: API, internals, and non-Perl stuff for UTF-$bits support"
412      echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"    if [ $utf -eq 0 ] ; then
413      ./pcretest $testdata/testinput5 testtry      echo "  Skipped because UTF-$bits support is not available"
414      else
415        for opt in "" "-s" $jitopt; do
416          $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
428    fi
429    
430    if [ $do6 = yes ] ; then
431      echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"
432      if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
433        echo "  Skipped because Unicode property support is not available"
434      else
435        for opt in "" "-s" $jitopt; do
436          $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
448    fi
449    
450    # Test non-Perl-compatible Unicode property support
451    
452    if [ $do7 = yes ] ; then
453      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
477        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
478      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
479        $cf testtry $testdata/testoutput5        $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
483      echo "OK"      if [ "$opt" = "-s" ] ; then echo "  OK with study" ; else echo "  OK"; fi
484      echo " "    done
485    fi
486    
487    if [ $do9 = yes ] ; then
488      echo "Test 9: DFA matching with UTF-$bits"
489      if [ $utf -eq 0 ] ; then
490        echo "  Skipped because UTF-$bits support is not available"
491    else    else
492      echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\)      for opt in "" "-s"; do
493      echo " "        $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    fi
502  fi  fi
503    
504  if [ $do6 = yes ] ; then  if [ $do10 = yes ] ; then
505    if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then    echo "Test 10: DFA matching with Unicode properties"
506      echo "Test 6: Unicode property support"    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
507      ./pcretest $testdata/testinput6 testtry      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
519    fi
520    
521    # 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
523    # 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
525    # 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 [ $do11 = yes ] ; then
529      echo "Test 11: Internal offsets and code size tests"
530      if [ $link_size -ne 2 ] ; then
531        echo "  Skipped because link size is not 2"
532      elif [ $ucp -eq 0 ] ; then
533        echo "  Skipped because Unicode property support is not available"
534      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
545    fi
546    
547    # Test JIT-specific features when JIT is available
548    
549    if [ $do12 = yes ] ; then
550      echo "Test 12: JIT-specific features (JIT available)"
551      if [ $jit -eq 0 ] ; then
552        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 testtry $testdata/testoutput6        $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      echo "OK"      echo "  OK"
561      echo " "    fi
562    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    else
571      echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\)      $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
572      echo " "      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    fi
579  fi  fi
580    
581  # Tests for DFA matching support  # Tests for 8-bit-specific features
582    
583  if [ $do7 = yes ] ; then  if [ "$do14" = yes ] ; then
584    echo "Test 7: DFA matching"    echo "Test 14: specials for the basic 8-bit library"
585    ./pcretest -dfa $testdata/testinput7 testtry    if [ "$bits" = "16" ] ; then
586    if [ $? = 0 ] ; then      echo "  Skipped when running 16-bit tests"
587      $cf testtry $testdata/testoutput7    else
588      if [ $? != 0 ] ; then exit 1; fi      cp -f $testdata/saved16 testsaved16
589    else exit 1      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    fi
   echo "OK"  
   echo " "  
602  fi  fi
603    
604  if [ $do8 = yes ] ; then  # Tests for 8-bit-specific features (needs UTF-8 support)
605    echo "Test 8: DFA matching with UTF-8"  
606    ./pcretest -dfa $testdata/testinput8 testtry  if [ "$do15" = yes ] ; then
607    if [ $? = 0 ] ; then    echo "Test 15: specials for the 8-bit library with UTF-8 support"
608      $cf testtry $testdata/testoutput8    if [ "$bits" = "16" ] ; then
609      if [ $? != 0 ] ; then exit 1; fi      echo "  Skipped when running 16-bit tests"
610    else exit 1    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    fi
   echo "OK"  
   echo " "  
626  fi  fi
627    
628  if [ $do9 = yes ] ; then  # Tests for 8-bit-specific features (Unicode property support)
629    echo "Test 9: DFA matching with Unicode properties"  
630    ./pcretest -dfa $testdata/testinput9 testtry  if [ $do16 = yes ] ; then
631    if [ $? = 0 ] ; then    echo "Test 16: specials for the 8-bit library with Unicode propery support"
632      $cf testtry $testdata/testoutput9    if [ "$bits" = "16" ] ; then
633      if [ $? != 0 ] ; then exit 1; fi      echo "  Skipped when running 16-bit tests"
634    else exit 1    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    fi
   echo "OK"  
   echo " "  
675  fi  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
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
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.81  
changed lines
  Added in v.842

  ViewVC Help
Powered by ViewVC 1.1.5