/[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 912 by ph10, Sun Feb 12 16:53:39 2012 UTC
# Line 18  Line 18 
18  # two tests for JIT-specific features, one to be run when JIT support is  # two tests for JIT-specific features, one to be run when JIT support is
19  # available, and one when it is not.  # available, and one when it is not.
20    
21  # The arguments for this script can be individual test numbers, or the word  # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
22    # 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  # "valgrind", or "sim" followed by an argument to run cross-compiled
26  # executables under a simulator, for example:  # executables under a simulator, for example:
27  #  #
# Line 26  Line 29 
29    
30  valgrind=  valgrind=
31  sim=  sim=
32    arg8=
33    arg16=
34    
35    # This is in case the caller has set aliases (as I do - PH)
36    unset cp ls mv rm
37    
38  # Select which tests to run; for those that are explicitly requested, check  # Select which tests to run; for those that are explicitly requested, check
39  # that the necessary optional facilities are available.  # that the necessary optional facilities are available.
# Line 45  do12=no Line 53  do12=no
53  do13=no  do13=no
54  do14=no  do14=no
55  do15=no  do15=no
56    do16=no
57    do17=no
58    do18=no
59    do19=no
60    do20=no
61    do21=no
62    do22=no
63    
64  while [ $# -gt 0 ] ; do  while [ $# -gt 0 ] ; do
65    case $1 in    case $1 in
# Line 63  while [ $# -gt 0 ] ; do Line 78  while [ $# -gt 0 ] ; do
78     13) do13=yes;;     13) do13=yes;;
79     14) do14=yes;;     14) do14=yes;;
80     15) do15=yes;;     15) do15=yes;;
81       16) do16=yes;;
82       17) do17=yes;;
83       18) do18=yes;;
84       19) do19=yes;;
85       20) do20=yes;;
86       21) do21=yes;;
87       22) do22=yes;;
88       -8) arg8=yes;;
89      -16) arg16=yes;;
90     valgrind) valgrind="valgrind -q --smc-check=all";;     valgrind) valgrind="valgrind -q --smc-check=all";;
91     sim) shift; sim=$1;;     sim) shift; sim=$1;;
92      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number $1"; exit 1;;
# Line 77  if diff -u /dev/null /dev/null; then cf= Line 101  if diff -u /dev/null /dev/null; then cf=
101    
102  # Find the test data  # Find the test data
103    
 testdata=testdata  
104  if [ -n "$srcdir" -a -d "$srcdir" ] ; then  if [ -n "$srcdir" -a -d "$srcdir" ] ; then
105    testdata="$srcdir/testdata"    testdata="$srcdir/testdata"
106    elif [ -d "./testdata" ] ; then
107      testdata=./testdata
108    elif [ -d "../testdata" ] ; then
109      testdata=../testdata
110    else
111      echo "Cannot find the testdata directory"
112      exit 1
113  fi  fi
114    
115  # Find which optional facilities are available  # Find which optional facilities are available. In some Windows environments
116    # the output of pcretest -C has CRLF at the end of each line, but the shell
117    # strips only linefeeds from the output of a `backquoted` command. Hence the
118    # alternative patterns.
119    
120    $sim ./pcretest -C linksize >/dev/null
121    link_size=$?
122    if [ $link_size -lt 2 ] ; then
123      echo "Failed to find internal link size"
124      exit 1
125    fi
126    if [ $link_size -gt 4 ] ; then
127      echo "Failed to find internal link size"
128      exit 1
129    fi
130    
131    # Both 8-bit and 16-bit character strings may be supported, but only one
132    # need be.
133    
134    $sim ./pcretest -C pcre8 >/dev/null
135    support8=$?
136    $sim ./pcretest -C pcre16 >/dev/null
137    support16=$?
138    if [ `expr $support8 + $support16` -eq 2 ] ; then
139      test8=
140      test16=-16
141      if [ "$arg8" = yes -a "$arg16" != yes ] ; then
142        test16=skip
143      fi
144      if [ "$arg16" = yes -a "$arg8" != yes ] ; then
145        test8=skip
146      fi
147    else
148      if [ $support8 -ne 0 ] ; then
149        if [ "$arg16" = yes ] ; then
150          echo "Cannot run 16-bit library tests: 16-bit library not compiled"
151          exit 1
152        fi
153        test8=
154        test16=skip
155      else
156        if [ "$arg8" = yes ] ; then
157          echo "Cannot run 8-bit library tests: 8-bit library not compiled"
158          exit 1
159        fi
160        test8=skip
161        test16=-16
162      fi
163    fi
164    
165  case `$sim ./pcretest -C | $sim ./pcregrep 'Internal link size'` in  # UTF support always applies to both bit sizes if both are supported; we can't
166    *2) link_size=2;;  # have UTF-8 support without UTF-16 support (for example).
   *3) link_size=3;;  
   *4) link_size=4;;  
    *) echo "Failed to find internal link size"; exit 1;;  
 esac  
167    
168  $sim ./pcretest -C | $sim ./pcregrep 'No UTF-8 support' >/dev/null  $sim ./pcretest -C utf >/dev/null
169  utf8=$?  utf=$?
170    
171  $sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null  $sim ./pcretest -C ucp >/dev/null
172  ucp=$?  ucp=$?
173    
174  jitopt=  jitopt=
175  $sim ./pcretest -C | $sim ./pcregrep 'No just-in-time compiler support' \  $sim ./pcretest -C jit >/dev/null
   >/dev/null  
176  jit=$?  jit=$?
177  if [ $jit -ne 0 ] ; then  if [ $jit -ne 0 ] ; then
178    jitopt=-s+    jitopt=-s+
179  fi  fi
180    
181  if [ $utf8 -eq 0 ] ; then  if [ $utf -eq 0 ] ; then
182    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
183      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"
184      exit 1      exit 1
185    fi    fi
186    if [ $do5 = yes ] ; then    if [ $do5 = yes ] ; then
187      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"
188      exit 1      exit 1
189    fi    fi
190    if [ $do8 = yes ] ; then    if [ $do9 = yes ] ; then
191      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"
192      exit 1      exit 1
193    fi    fi
194    if [ $do12 = yes ] ; then    if [ $do15 = yes ] ; then
195      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"
196      exit 1      exit 1
197    fi    fi
198      if [ $do18 = yes ] ; then
199        echo "Can't run test 18 because UTF support is not configured"
200      fi
201      if [ $do22 = yes ] ; then
202        echo "Can't run test 22 because UTF support is not configured"
203      fi
204  fi  fi
205    
206  if [ $ucp -eq 0 ] ; then  if [ $ucp -eq 0 ] ; then
# Line 129  if [ $ucp -eq 0 ] ; then Line 208  if [ $ucp -eq 0 ] ; then
208      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"
209      exit 1      exit 1
210    fi    fi
211    if [ $do9 = yes ] ; then    if [ $do7 = yes ] ; then
212      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"
213      exit 1      exit 1
214    fi    fi
215    if [ $do10 = yes ] ; then    if [ $do10 = yes ] ; then
216      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"
217      exit 1      exit 1
218    fi    fi
219    if [ $do13 = yes ] ; then    if [ $do16 = yes ] ; then
220      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"
221        exit 1
222      fi
223      if [ $do19 = yes ] ; then
224        echo "Can't run test 19 because Unicode property support is not configured"
225      exit 1      exit 1
226    fi    fi
227  fi  fi
228    
229  if [ $link_size -ne 2 ] ; then  if [ $link_size -ne 2 ] ; then
230    if [ $do10 = yes ] ; then    if [ $do11 = yes ] ; then
231      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"
232      exit 1      exit 1
233    fi    fi
234  fi  fi
235    
236  if [ $jit -eq 0 ] ; then  if [ $jit -eq 0 ] ; then
237    if [ $do14 = "yes" ] ; then    if [ $do12 = "yes" ] ; then
238      echo "Can't run test 14 because JIT support is not configured"      echo "Can't run test 12 because JIT support is not configured"
239      exit 1      exit 1
240    fi    fi
241  else  else
242    if [ $do15 = "yes" ] ; then    if [ $do13 = "yes" ] ; then
243      echo "Can't run test 15 because JIT support is configured"      echo "Can't run test 13 because JIT support is configured"
244      exit 1      exit 1
245    fi    fi
246  fi  fi
# Line 168  fi Line 251  fi
251  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 \
252       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \
253       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \       $do9  = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
254       $do13 = no -a $do14 = no -a $do15 = no ] ; then       $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
255         $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \
256         $do21 = no -a $do22 = no ] ; then
257    do1=yes    do1=yes
258    do2=yes    do2=yes
259    do3=yes    do3=yes
# Line 184  if [ $do1  = no -a $do2  = no -a $do3  = Line 269  if [ $do1  = no -a $do2  = no -a $do3  =
269    do13=yes    do13=yes
270    do14=yes    do14=yes
271    do15=yes    do15=yes
272      do16=yes
273      do17=yes
274      do18=yes
275      do19=yes
276      do20=yes
277      do21=yes
278      do22=yes
279  fi  fi
280    
281  # Show which release  # Show which release and which test data
282    
283  echo ""  echo ""
284  echo PCRE C library tests  echo PCRE C library tests using test data from $testdata
285  ./pcretest /dev/null  $sim ./pcretest /dev/null
286    
287    for bmode in "$test8" "$test16"; do
288      case "$bmode" in
289        skip) continue;;
290        -16)  if [ "$test8" != "skip" ] ; then echo ""; fi
291              bits=16; echo "---- Testing 16-bit library ----"; echo "";;
292        *)    bits=8; echo "---- Testing 8-bit library ----"; echo "";;
293      esac
294    
295  # Primary test, compatible with JIT and all versions of Perl >= 5.8  # Primary test, compatible with JIT and all versions of Perl >= 5.8
296    
297  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
298    echo "Test 1: main functionality (Compatible with Perl >= 5.8)"    echo "Test 1: main functionality (Compatible with Perl >= 5.10)"
299    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
300      $sim $valgrind ./pcretest -q $opt $testdata/testinput1 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
301      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
302        $cf $testdata/testoutput1 testtry        $cf $testdata/testoutput1 testtry
303        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 213  fi Line 313  fi
313  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
314    
315  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
316    echo "Test 2: API, errors, internals, and non-Perl stuff"    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)"
317    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
318      $sim $valgrind ./pcretest -q $opt $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
319      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
320        $cf $testdata/testoutput2 testtry        $cf $testdata/testoutput2 testtry
321        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 237  fi Line 337  fi
337    
338  # Locale-specific tests, provided that either the "fr_FR" or the "french"  # Locale-specific tests, provided that either the "fr_FR" or the "french"
339  # 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
340  # for Windows.  # for Windows. Another possibility is "fr", which needs to be run against
341    # the Windows-specific input and output files.
342    
343  if [ $do3 = yes ] ; then  if [ $do3 = yes ] ; then
344    locale -a | grep '^fr_FR$' >/dev/null    locale -a | grep '^fr_FR$' >/dev/null
# Line 246  if [ $do3 = yes ] ; then Line 347  if [ $do3 = yes ] ; then
347      infile=$testdata/testinput3      infile=$testdata/testinput3
348      outfile=$testdata/testoutput3      outfile=$testdata/testoutput3
349    else    else
350        infile=test3input
351        outfile=test3output
352      locale -a | grep '^french$' >/dev/null      locale -a | grep '^french$' >/dev/null
353      if [ $? -eq 0 ] ; then      if [ $? -eq 0 ] ; then
354        locale=french        locale=french
355        sed 's/fr_FR/french/' $testdata/testinput3 >test3input        sed 's/fr_FR/french/' $testdata/testinput3 >test3input
356        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
       infile=test3input  
       outfile=test3output  
357      else      else
358        locale=        locale -a | grep '^fr$' >/dev/null
359          if [ $? -eq 0 ] ; then
360            locale=fr
361            sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
362            sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
363          else
364            locale=
365          fi
366      fi      fi
367    fi    fi
368    
369    if [ "$locale" != "" ] ; then    if [ "$locale" != "" ] ; then
370      echo "Test 3: locale-specific features (using '$locale' locale)"      echo "Test 3: locale-specific features (using '$locale' locale)"
371      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
372        $sim $valgrind ./pcretest -q $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
373        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
374          $cf $outfile testtry          $cf $outfile testtry
375          if [ $? != 0 ] ; then          if [ $? != 0 ] ; then
# Line 280  if [ $do3 = yes ] ; then Line 388  if [ $do3 = yes ] ; then
388        fi        fi
389      done      done
390    else    else
391      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"
392      echo "'french' locale exists, or the \"locale\" command is not available"      echo "'french' locales exist, or the \"locale\" command is not available"
393      echo "to check for them."      echo "to check for them."
394      echo " "      echo " "
395    fi    fi
396  fi  fi
397    
398  # Additional tests for UTF8 support  # Additional tests for UTF support
399    
400  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
401    echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)"    echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.10)"
402    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
403      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
404    else    else
405      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
406        $sim $valgrind ./pcretest -q $opt $testdata/testinput4 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
407        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
408          $cf $testdata/testoutput4 testtry          $cf $testdata/testoutput4 testtry
409          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 310  if [ $do4 = yes ] ; then Line 418  if [ $do4 = yes ] ; then
418  fi  fi
419    
420  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
421    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"
422    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
423      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
424    else    else
425      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
426        $sim $valgrind ./pcretest -q $opt $testdata/testinput5 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
427        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
428          $cf $testdata/testoutput5 testtry          $cf $testdata/testoutput5 testtry
429          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 331  fi Line 439  fi
439    
440  if [ $do6 = yes ] ; then  if [ $do6 = yes ] ; then
441    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"
442    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
443      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
444    else    else
445      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
446        $sim $valgrind ./pcretest -q $opt $testdata/testinput6 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
447        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
448          $cf $testdata/testoutput6 testtry          $cf $testdata/testoutput6 testtry
449          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 349  if [ $do6 = yes ] ; then Line 457  if [ $do6 = yes ] ; then
457    fi    fi
458  fi  fi
459    
460  # Tests for DFA matching support  # Test non-Perl-compatible Unicode property support
461    
462  if [ $do7 = yes ] ; then  if [ $do7 = yes ] ; then
463    echo "Test 7: DFA matching"    echo "Test 7: API, internals, and non-Perl stuff for Unicode property support"
464      if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
465        echo "  Skipped because Unicode property support is not available"
466      else
467        for opt in "" "-s" $jitopt; do
468          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
469          if [ $? = 0 ] ; then
470            $cf $testdata/testoutput7 testtry
471            if [ $? != 0 ] ; then exit 1; fi
472          else exit 1
473          fi
474          if [ "$opt" = "-s" ] ; then echo "  OK with study"
475          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
476          else echo "  OK"
477          fi
478        done
479      fi
480    fi
481    
482    # Tests for DFA matching support
483    
484    if [ $do8 = yes ] ; then
485      echo "Test 8: DFA matching main functionality"
486    for opt in "" "-s"; do    for opt in "" "-s"; do
487      $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
488      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
489        $cf $testdata/testoutput7 testtry        $cf $testdata/testoutput8 testtry
490        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
491      else exit 1      else exit 1
492      fi      fi
# Line 364  if [ $do7 = yes ] ; then Line 494  if [ $do7 = yes ] ; then
494    done    done
495  fi  fi
496    
497  if [ $do8 = yes ] ; then  if [ $do9 = yes ] ; then
498    echo "Test 8: DFA matching with UTF-8"    echo "Test 9: DFA matching with UTF-$bits"
499    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
500      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF-$bits support is not available"
501    else    else
502      for opt in "" "-s"; do      for opt in "" "-s"; do
503        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
504        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
505          $cf $testdata/testoutput8 testtry          $cf $testdata/testoutput9 testtry
506          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
507        else exit 1        else exit 1
508        fi        fi
# Line 381  if [ $do8 = yes ] ; then Line 511  if [ $do8 = yes ] ; then
511    fi    fi
512  fi  fi
513    
514  if [ $do9 = yes ] ; then  if [ $do10 = yes ] ; then
515    echo "Test 9: DFA matching with Unicode properties"    echo "Test 10: DFA matching with Unicode properties"
516    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
517      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
518    else    else
519      for opt in "" "-s"; do      for opt in "" "-s"; do
520        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
521        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
522          $cf $testdata/testoutput9 testtry          $cf $testdata/testoutput10 testtry
523          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
524        else exit 1        else exit 1
525        fi        fi
# Line 402  fi Line 532  fi
532  # 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
533  # 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
534  # 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
535  # the maintainer, just in case something changes unexpectely.  # the maintainer, just in case something changes unexpectely. The output from
536    # this test is not the same in 8-bit and 16-bit modes.
537    
538  if [ $do10 = yes ] ; then  if [ $do11 = yes ] ; then
539    echo "Test 10: Internal offsets and code size tests"    echo "Test 11: Internal offsets and code size tests"
540    if [ $link_size -ne 2 ] ; then    if [ $link_size -ne 2 ] ; then
541      echo "  Skipped because link size is not 2"      echo "  Skipped because link size is not 2"
542    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
543      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
544    else    else
545      for opt in "" "-s"; do      for opt in "" "-s"; do
546        $sim $valgrind ./pcretest -q $opt $testdata/testinput10 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
547        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
548          $cf $testdata/testoutput10 testtry          $cf $testdata/testoutput11-$bits testtry
549          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
550        else exit 1        else exit 1
551        fi        fi
# Line 423  if [ $do10 = yes ] ; then Line 554  if [ $do10 = yes ] ; then
554    fi    fi
555  fi  fi
556    
557  # Test of Perl >= 5.10 features without UTF8 support  # Test JIT-specific features when JIT is available
558    
559  if [ $do11 = yes ] ; then  if [ $do12 = yes ] ; then
560    echo "Test 11: Features from Perl >= 5.10 without UTF8 support"    echo "Test 12: JIT-specific features (JIT available)"
561    for opt in "" "-s" $jitopt; do    if [ $jit -eq 0 ] ; then
562      $sim $valgrind ./pcretest -q $opt $testdata/testinput11 testtry      echo "  Skipped because JIT is not available or not usable"
563      else
564        $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
565      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
566        $cf $testdata/testoutput11 testtry        $cf $testdata/testoutput12 testtry
567        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
568      else exit 1      else exit 1
569      fi      fi
570      if [ "$opt" = "-s" ] ; then echo "  OK with study"      echo "  OK"
571      elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"    fi
572      else echo "  OK"  fi
573    
574    # Test JIT-specific features when JIT is not available
575    
576    if [ $do13 = yes ] ; then
577      echo "Test 13: JIT-specific features (JIT not available)"
578      if [ $jit -ne 0 ] ; then
579        echo "  Skipped because JIT is available"
580      else
581        $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
582        if [ $? = 0 ] ; then
583          $cf $testdata/testoutput13 testtry
584          if [ $? != 0 ] ; then exit 1; fi
585        else exit 1
586      fi      fi
587    done      echo "  OK"
588      fi
589  fi  fi
590    
591  # Test of Perl >= 5.10 features with UTF8 support  # Tests for 8-bit-specific features
592    
593  if [ $do12 = yes ] ; then  if [ "$do14" = yes ] ; then
594    echo "Test 12: Features from Perl >= 5.10 with UTF8 support"    echo "Test 14: specials for the basic 8-bit library"
595    if [ $utf8 -eq 0 ] ; then    if [ "$bits" = "16" ] ; then
596      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped when running 16-bit tests"
597    else    else
598        cp -f $testdata/saved16 testsaved16
599      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
600        $sim $valgrind ./pcretest -q $opt $testdata/testinput12 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
601        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
602          $cf $testdata/testoutput12 testtry          $cf $testdata/testoutput14 testtry
603          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
604        else exit 1        else exit 1
605        fi        fi
# Line 463  if [ $do12 = yes ] ; then Line 611  if [ $do12 = yes ] ; then
611    fi    fi
612  fi  fi
613    
614  # Test non-Perl-compatible Unicode property support  # Tests for 8-bit-specific features (needs UTF-8 support)
615    
616  if [ $do13 = yes ] ; then  if [ "$do15" = yes ] ; then
617    echo "Test 13: API, internals, and non-Perl stuff for Unicode property support"    echo "Test 15: specials for the 8-bit library with UTF-8 support"
618    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ "$bits" = "16" ] ; then
619        echo "  Skipped when running 16-bit tests"
620      elif [ $utf -eq 0 ] ; then
621        echo "  Skipped because UTF-$bits support is not available"
622      else
623        for opt in "" "-s" $jitopt; do
624          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
625          if [ $? = 0 ] ; then
626            $cf $testdata/testoutput15 testtry
627            if [ $? != 0 ] ; then exit 1; fi
628          else exit 1
629          fi
630          if [ "$opt" = "-s" ] ; then echo "  OK with study"
631          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
632          else echo "  OK"
633          fi
634        done
635      fi
636    fi
637    
638    # Tests for 8-bit-specific features (Unicode property support)
639    
640    if [ $do16 = yes ] ; then
641      echo "Test 16: specials for the 8-bit library with Unicode propery support"
642      if [ "$bits" = "16" ] ; then
643        echo "  Skipped when running 16-bit tests"
644      elif [ $ucp -eq 0 ] ; then
645      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
646    else    else
647      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
648        $sim $valgrind ./pcretest -q $opt $testdata/testinput13 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
649        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
650          $cf $testdata/testoutput13 testtry          $cf $testdata/testoutput16 testtry
651          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
652        else exit 1        else exit 1
653        fi        fi
# Line 485  if [ $do13 = yes ] ; then Line 659  if [ $do13 = yes ] ; then
659    fi    fi
660  fi  fi
661    
662  # Test JIT-specific features when JIT is available  # Tests for 16-bit-specific features
663    
664  if [ $do14 = yes ] ; then  if [ $do17 = yes ] ; then
665    echo "Test 14: JIT-specific features (JIT available)"    echo "Test 17: specials for the basic 16-bit library"
666    if [ $jit -eq 0 ] ; then    if [ "$bits" = "8" ] ; then
667      echo "  Skipped because JIT is not available or not usable"      echo "  Skipped when running 8-bit tests"
668    else    else
669      $sim $valgrind ./pcretest -q $testdata/testinput14 testtry      for opt in "" "-s" $jitopt; do
670          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
671          if [ $? = 0 ] ; then
672            $cf $testdata/testoutput17 testtry
673            if [ $? != 0 ] ; then exit 1; fi
674          else exit 1
675          fi
676          if [ "$opt" = "-s" ] ; then echo "  OK with study"
677          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
678          else echo "  OK"
679          fi
680        done
681      fi
682    fi
683    
684    # Tests for 16-bit-specific features (UTF-16 support)
685    
686    if [ $do18 = yes ] ; then
687      echo "Test 18: specials for the 16-bit library with UTF-16 support"
688      if [ "$bits" = "8" ] ; then
689        echo "  Skipped when running 8-bit tests"
690      elif [ $utf -eq 0 ] ; then
691        echo "  Skipped because UTF-$bits support is not available"
692      else
693        for opt in "" "-s" $jitopt; do
694          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
695          if [ $? = 0 ] ; then
696            $cf $testdata/testoutput18 testtry
697            if [ $? != 0 ] ; then exit 1; fi
698          else exit 1
699          fi
700          if [ "$opt" = "-s" ] ; then echo "  OK with study"
701          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
702          else echo "  OK"
703          fi
704        done
705      fi
706    fi
707    
708    # Tests for 16-bit-specific features (Unicode property support)
709    
710    if [ $do19 = yes ] ; then
711      echo "Test 19: specials for the 16-bit library with Unicode propery support"
712      if [ "$bits" = "8" ] ; then
713        echo "  Skipped when running 8-bit tests"
714      elif [ $ucp -eq 0 ] ; then
715        echo "  Skipped because Unicode property support is not available"
716      else
717        for opt in "" "-s" $jitopt; do
718          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
719          if [ $? = 0 ] ; then
720            $cf $testdata/testoutput19 testtry
721            if [ $? != 0 ] ; then exit 1; fi
722          else exit 1
723          fi
724          if [ "$opt" = "-s" ] ; then echo "  OK with study"
725          elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
726          else echo "  OK"
727          fi
728        done
729      fi
730    fi
731    
732    # Tests for 16-bit-specific features in DFA non-UTF-16 mode
733    
734    if [ $do20 = yes ] ; then
735      echo "Test 20: DFA specials for the basic 16-bit library"
736      if [ "$bits" = "8" ] ; then
737        echo "  Skipped when running 8-bit tests"
738      else
739        for opt in "" "-s"; do
740          $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry
741          if [ $? = 0 ] ; then
742            $cf $testdata/testoutput20 testtry
743            if [ $? != 0 ] ; then exit 1; fi
744          else exit 1
745          fi
746          if [ "$opt" = "-s" ] ; then echo "  OK with study"
747          else echo "  OK"
748          fi
749        done
750      fi
751    fi
752    
753    # Tests for reloads with 16-bit library
754    
755    if [ $do21 = yes ] ; then
756      echo "Test 21: reloads for the basic 16-bit library"
757      if [ "$bits" = "8" ] ; then
758        echo "  Skipped when running 8-bit tests"
759      elif [ $link_size -ne 2 ] ; then
760        echo "  Skipped because link size is not 2"
761      else
762        cp -f $testdata/saved8 testsaved8
763        cp -f $testdata/saved16LE-1 testsaved16LE-1
764        cp -f $testdata/saved16BE-1 testsaved16BE-1
765        $sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry
766      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
767        $cf $testdata/testoutput14 testtry        $cf $testdata/testoutput21 testtry
768        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
769      else exit 1      else exit 1
770      fi      fi
# Line 502  if [ $do14 = yes ] ; then Line 772  if [ $do14 = yes ] ; then
772    fi    fi
773  fi  fi
774    
775  # Test JIT-specific features when JIT is not available  # Tests for reloads with 16-bit library (UTF-16 support)
776    
777  if [ $do15 = yes ] ; then  if [ $do22 = yes ] ; then
778    echo "Test 15: JIT-specific features (JIT not available)"    echo "Test 22: reloads for the 16-bit library with UTF-16 support"
779    if [ $jit -ne 0 ] ; then    if [ "$bits" = "8" ] ; then
780      echo "  Skipped because JIT is available"      echo "  Skipped when running 8-bit tests"
781      elif [ $utf -eq 0 ] ; then
782        echo "  Skipped because UTF-$bits support is not available"
783      elif [ $link_size -ne 2 ] ; then
784        echo "  Skipped because link size is not 2"
785    else    else
786      $sim $valgrind ./pcretest -q $testdata/testinput15 testtry      cp -f $testdata/saved16LE-2 testsaved16LE-2
787        cp -f $testdata/saved16BE-2 testsaved16BE-2
788        $sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry
789      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
790        $cf $testdata/testoutput15 testtry        $cf $testdata/testoutput22 testtry
791        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
792      else exit 1      else exit 1
793      fi      fi
# Line 519  if [ $do15 = yes ] ; then Line 795  if [ $do15 = yes ] ; then
795    fi    fi
796  fi  fi
797    
798    # End of loop for 8-bit/16-bit tests
799    done
800    
801    # Clean up local working files
802    rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
803    
804  # End  # End

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

  ViewVC Help
Powered by ViewVC 1.1.5