/[pcre]/code/branches/pcre16/RunTest
ViewVC logotype

Diff of /code/branches/pcre16/RunTest

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

revision 807 by ph10, Mon Dec 12 16:23:37 2011 UTC revision 808 by ph10, Sun Dec 18 11:11:48 2011 UTC
# Line 100  case `$sim ./pcretest -C | $sim ./pcregr Line 100  case `$sim ./pcretest -C | $sim ./pcregr
100     *) echo "Failed to find internal link size"; exit 1;;     *) echo "Failed to find internal link size"; exit 1;;
101  esac  esac
102    
103  $sim ./pcretest -C | $sim ./pcregrep 'No UTF-8 support' >/dev/null  # Both 8-bit and 16-bit character strings may be supported, but only one
104  utf8=$?  # need be.
105    
106    $sim ./pcretest -C | $sim ./pcregrep '8-bit and 16-bit support' >/dev/null
107    if [ $? -eq 0 ] ; then
108      test8=
109      test16=-16
110    else
111      $sim ./pcretest -C | $sim ./pcregrep '8-bit support' >/dev/null
112      if [ $? -eq 0 ] ; then
113        test8=
114        test16=skip
115      else
116        test8=skip
117        test16=-16
118      fi
119    fi
120    
121    # UTF support always applies to both bit sizes if both are supported; we can't
122    # have UTF-8 support without UTF-16 support (for example).
123    
124    $sim ./pcretest -C | $sim ./pcregrep 'No UTF-(.+?) support' >/dev/null
125    utf=$?
126    
127  $sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null  $sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null
128  ucp=$?  ucp=$?
# Line 114  if [ $jit -ne 0 ] ; then Line 135  if [ $jit -ne 0 ] ; then
135    jitopt=-s+    jitopt=-s+
136  fi  fi
137    
138  if [ $utf8 -eq 0 ] ; then  if [ $utf -eq 0 ] ; then
139    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
140      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"
141      exit 1      exit 1
142    fi    fi
143    if [ $do5 = yes ] ; then    if [ $do5 = yes ] ; then
144      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"
145      exit 1      exit 1
146    fi    fi
147    if [ $do8 = yes ] ; then    if [ $do8 = yes ] ; then
148      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"
149      exit 1      exit 1
150    fi    fi
151    if [ $do12 = yes ] ; then    if [ $do12 = yes ] ; then
152      echo "Can't run test 12 because UTF-8 support is not configured"      echo "Can't run test 12 because UTF support is not configured"
153      exit 1      exit 1
154    fi    fi
155  fi  fi
# Line 201  echo "" Line 222  echo ""
222  echo PCRE C library tests using test data from $testdata  echo PCRE C library tests using test data from $testdata
223  $sim ./pcretest /dev/null  $sim ./pcretest /dev/null
224    
225    for bmode in "$test8" "$test16"; do
226      case "$bmode" in
227        skip) continue;;
228        -16)  if [ "$test8" != "skip" ] ; then echo ""; fi
229              echo "---- Testing 16-bit library ----"; echo "";;
230        *)    echo "---- Testing 8-bit library ----"; echo "";;
231      esac
232    
233  # Primary test, compatible with JIT and all versions of Perl >= 5.8  # Primary test, compatible with JIT and all versions of Perl >= 5.8
234    
235  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
236    echo "Test 1: main functionality (Compatible with Perl >= 5.8)"    echo "Test 1: main functionality (Compatible with Perl >= 5.8)"
237    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
238      $sim $valgrind ./pcretest -q $opt $testdata/testinput1 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
239      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
240        $cf $testdata/testoutput1 testtry        $cf $testdata/testoutput1 testtry
241        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 222  fi Line 251  fi
251  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
252    
253  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
254    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-8)"    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-8/16)"
255    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
256      $sim $valgrind ./pcretest -q $opt $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
257      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
258        $cf $testdata/testoutput2 testtry        $cf $testdata/testoutput2 testtry
259        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 278  if [ $do3 = yes ] ; then Line 307  if [ $do3 = yes ] ; then
307    if [ "$locale" != "" ] ; then    if [ "$locale" != "" ] ; then
308      echo "Test 3: locale-specific features (using '$locale' locale)"      echo "Test 3: locale-specific features (using '$locale' locale)"
309      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
310        $sim $valgrind ./pcretest -q $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
311        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
312          $cf $outfile testtry          $cf $outfile testtry
313          if [ $? != 0 ] ; then          if [ $? != 0 ] ; then
# Line 304  if [ $do3 = yes ] ; then Line 333  if [ $do3 = yes ] ; then
333    fi    fi
334  fi  fi
335    
336  # Additional tests for UTF8 support  # Additional tests for UTF support
337    
338  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
339    echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)"    echo "Test 4: UTF-8/16 support (Compatible with Perl >= 5.8)"
340    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
341      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF support is not available"
342    else    else
343      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
344        $sim $valgrind ./pcretest -q $opt $testdata/testinput4 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
345        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
346          $cf $testdata/testoutput4 testtry          $cf $testdata/testoutput4 testtry
347          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 327  if [ $do4 = yes ] ; then Line 356  if [ $do4 = yes ] ; then
356  fi  fi
357    
358  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
359    echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support"    echo "Test 5: API, internals, and non-Perl stuff for UTF-8/16 support"
360    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
361      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF support is not available"
362    else    else
363      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
364        $sim $valgrind ./pcretest -q $opt $testdata/testinput5 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
365        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
366          $cf $testdata/testoutput5 testtry          $cf $testdata/testoutput5 testtry
367          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 348  fi Line 377  fi
377    
378  if [ $do6 = yes ] ; then  if [ $do6 = yes ] ; then
379    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"
380    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
381      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
382    else    else
383      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
384        $sim $valgrind ./pcretest -q $opt $testdata/testinput6 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
385        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
386          $cf $testdata/testoutput6 testtry          $cf $testdata/testoutput6 testtry
387          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 371  fi Line 400  fi
400  if [ $do7 = yes ] ; then  if [ $do7 = yes ] ; then
401    echo "Test 7: DFA matching"    echo "Test 7: DFA matching"
402    for opt in "" "-s"; do    for opt in "" "-s"; do
403      $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput7 testtry
404      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
405        $cf $testdata/testoutput7 testtry        $cf $testdata/testoutput7 testtry
406        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 382  if [ $do7 = yes ] ; then Line 411  if [ $do7 = yes ] ; then
411  fi  fi
412    
413  if [ $do8 = yes ] ; then  if [ $do8 = yes ] ; then
414    echo "Test 8: DFA matching with UTF-8"    echo "Test 8: DFA matching with UTF-8 or UTF-16"
415    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
416      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF support is not available"
417    else    else
418      for opt in "" "-s"; do      for opt in "" "-s"; do
419        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
420        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
421          $cf $testdata/testoutput8 testtry          $cf $testdata/testoutput8 testtry
422          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 400  fi Line 429  fi
429    
430  if [ $do9 = yes ] ; then  if [ $do9 = yes ] ; then
431    echo "Test 9: DFA matching with Unicode properties"    echo "Test 9: DFA matching with Unicode properties"
432    if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
433      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
434    else    else
435      for opt in "" "-s"; do      for opt in "" "-s"; do
436        $sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry        $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
437        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
438          $cf $testdata/testoutput9 testtry          $cf $testdata/testoutput9 testtry
439          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 429  if [ $do10 = yes ] ; then Line 458  if [ $do10 = yes ] ; then
458      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
459    else    else
460      for opt in "" "-s"; do      for opt in "" "-s"; do
461        $sim $valgrind ./pcretest -q $opt $testdata/testinput10 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput10 testtry
462        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
463          $cf $testdata/testoutput10 testtry          $cf $testdata/testoutput10 testtry
464          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 445  fi Line 474  fi
474  if [ $do11 = yes ] ; then  if [ $do11 = yes ] ; then
475    echo "Test 11: Features from Perl >= 5.10 without UTF8 support"    echo "Test 11: Features from Perl >= 5.10 without UTF8 support"
476    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
477      $sim $valgrind ./pcretest -q $opt $testdata/testinput11 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
478      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
479        $cf $testdata/testoutput11 testtry        $cf $testdata/testoutput11 testtry
480        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 461  fi Line 490  fi
490  # Test of Perl >= 5.10 features with UTF8 support  # Test of Perl >= 5.10 features with UTF8 support
491    
492  if [ $do12 = yes ] ; then  if [ $do12 = yes ] ; then
493    echo "Test 12: Features from Perl >= 5.10 with UTF8 support"    echo "Test 12: Features from Perl >= 5.10 with UTF-8 or UTF-16 support"
494    if [ $utf8 -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
495      echo "  Skipped because UTF-8 support is not available"      echo "  Skipped because UTF support is not available"
496    else    else
497      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
498        $sim $valgrind ./pcretest -q $opt $testdata/testinput12 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput12 testtry
499        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
500          $cf $testdata/testoutput12 testtry          $cf $testdata/testoutput12 testtry
501          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 484  fi Line 513  fi
513    
514  if [ $do13 = yes ] ; then  if [ $do13 = yes ] ; then
515    echo "Test 13: API, internals, and non-Perl stuff for Unicode property support"    echo "Test 13: API, internals, and non-Perl stuff for Unicode property support"
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" $jitopt; do      for opt in "" "-s" $jitopt; do
520        $sim $valgrind ./pcretest -q $opt $testdata/testinput13 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput13 testtry
521        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
522          $cf $testdata/testoutput13 testtry          $cf $testdata/testoutput13 testtry
523          if [ $? != 0 ] ; then exit 1; fi          if [ $? != 0 ] ; then exit 1; fi
# Line 509  if [ $do14 = yes ] ; then Line 538  if [ $do14 = yes ] ; then
538    if [ $jit -eq 0 ] ; then    if [ $jit -eq 0 ] ; then
539      echo "  Skipped because JIT is not available or not usable"      echo "  Skipped because JIT is not available or not usable"
540    else    else
541      $sim $valgrind ./pcretest -q $testdata/testinput14 testtry      $sim $valgrind ./pcretest -q $bmode $testdata/testinput14 testtry
542      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
543        $cf $testdata/testoutput14 testtry        $cf $testdata/testoutput14 testtry
544        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 526  if [ $do15 = yes ] ; then Line 555  if [ $do15 = yes ] ; then
555    if [ $jit -ne 0 ] ; then    if [ $jit -ne 0 ] ; then
556      echo "  Skipped because JIT is available"      echo "  Skipped because JIT is available"
557    else    else
558      $sim $valgrind ./pcretest -q $testdata/testinput15 testtry      $sim $valgrind ./pcretest -q $bmode $testdata/testinput15 testtry
559      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
560        $cf $testdata/testoutput15 testtry        $cf $testdata/testoutput15 testtry
561        if [ $? != 0 ] ; then exit 1; fi        if [ $? != 0 ] ; then exit 1; fi
# Line 536  if [ $do15 = yes ] ; then Line 565  if [ $do15 = yes ] ; then
565    fi    fi
566  fi  fi
567    
568    # End of loop for 8-bit/16-bit tests
569    
570    done
571    
572  # End  # End

Legend:
Removed from v.807  
changed lines
  Added in v.808

  ViewVC Help
Powered by ViewVC 1.1.5