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

Diff of /code/trunk/RunTest

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

revision 836 by ph10, Wed Dec 28 17:16:11 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  # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also  # 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.  # 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  # Other arguments for this script can be individual test numbers, or the word
# Line 32  sim= Line 32  sim=
32  arg8=  arg8=
33  arg16=  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.
40    
# Line 55  do17=no Line 58  do17=no
58  do18=no  do18=no
59  do19=no  do19=no
60  do20=no  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 77  while [ $# -gt 0 ] ; do Line 82  while [ $# -gt 0 ] ; do
82     17) do17=yes;;     17) do17=yes;;
83     18) do18=yes;;     18) do18=yes;;
84     19) do19=yes;;     19) do19=yes;;
85     20) do20=yes;;     20) do20=yes;;
86       21) do21=yes;;
87       22) do22=yes;;
88     -8) arg8=yes;;     -8) arg8=yes;;
89    -16) arg16=yes;;    -16) arg16=yes;;
90     valgrind) valgrind="valgrind -q --smc-check=all";;     valgrind) valgrind="valgrind -q --smc-check=all";;
# Line 128  $sim ./pcretest -C pcre8 >/dev/null Line 135  $sim ./pcretest -C pcre8 >/dev/null
135  support8=$?  support8=$?
136  $sim ./pcretest -C pcre16 >/dev/null  $sim ./pcretest -C pcre16 >/dev/null
137  support16=$?  support16=$?
138  if [ $(( $support8 + $support16 )) -eq 2 ] ; then  if [ `expr $support8 + $support16` -eq 2 ] ; then
139    test8=    test8=
140    test16=-16    test16=-16
141    if [ "$arg8" = yes -a "$arg16" != yes ] ; then    if [ "$arg8" = yes -a "$arg16" != yes ] ; then
# Line 190  if [ $utf -eq 0 ] ; then Line 197  if [ $utf -eq 0 ] ; then
197    fi    fi
198    if [ $do18 = yes ] ; then    if [ $do18 = yes ] ; then
199      echo "Can't run test 18 because UTF support is not configured"      echo "Can't run test 18 because UTF support is not configured"
200    fi    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 242  if [ $do1  = no -a $do2  = no -a $do3  = Line 252  if [ $do1  = no -a $do2  = no -a $do3  =
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 -a $do16 = no -a \       $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
255       $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no ] ; then       $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 262  if [ $do1  = no -a $do2  = no -a $do3  = Line 273  if [ $do1  = no -a $do2  = no -a $do3  =
273    do17=yes    do17=yes
274    do18=yes    do18=yes
275    do19=yes    do19=yes
276    do20=yes    do20=yes
277      do21=yes
278      do22=yes
279  fi  fi
280    
281  # Show which release and which test data  # Show which release and which test data
# Line 277  for bmode in "$test8" "$test16"; do Line 290  for bmode in "$test8" "$test16"; do
290      -16)  if [ "$test8" != "skip" ] ; then echo ""; fi      -16)  if [ "$test8" != "skip" ] ; then echo ""; fi
291            bits=16; echo "---- Testing 16-bit library ----"; echo "";;            bits=16; echo "---- Testing 16-bit library ----"; echo "";;
292      *)    bits=8; echo "---- Testing 8-bit library ----"; echo "";;      *)    bits=8; echo "---- Testing 8-bit library ----"; echo "";;
293    esac    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
# Line 581  if [ "$do14" = yes ] ; then Line 594  if [ "$do14" = yes ] ; then
594    echo "Test 14: specials for the basic 8-bit library"    echo "Test 14: specials for the basic 8-bit library"
595    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
596      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
597    elif [ $utf -eq 0 ] ; then    else
598      echo "  Skipped because UTF-$bits support is not available"      cp -f $testdata/saved16 testsaved16
   else  
599      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
600        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
601        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 607  if [ "$do15" = yes ] ; then Line 619  if [ "$do15" = yes ] ; then
619      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
620    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then
621      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
622    else    else
623      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
624        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
625        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 631  if [ $do16 = yes ] ; then Line 643  if [ $do16 = yes ] ; then
643      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
644    elif [ $ucp -eq 0 ] ; then    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 $bmode $opt $testdata/testinput16 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
649        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 653  if [ $do17 = yes ] ; then Line 665  if [ $do17 = yes ] ; then
665    echo "Test 17: specials for the basic 16-bit library"    echo "Test 17: specials for the basic 16-bit library"
666    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
667      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
668    else    else
669      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
670        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
671        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 677  if [ $do18 = yes ] ; then Line 689  if [ $do18 = yes ] ; then
689      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
690    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then
691      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
692    else    else
693      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
694        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
695        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 701  if [ $do19 = yes ] ; then Line 713  if [ $do19 = yes ] ; then
713      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
714    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
715      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
716    else    else
717      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
718        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
719        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 723  if [ $do20 = yes ] ; then Line 735  if [ $do20 = yes ] ; then
735    echo "Test 20: DFA specials for the basic 16-bit library"    echo "Test 20: DFA specials for the basic 16-bit library"
736    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
737      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
738    else    else
739      for opt in "" "-s"; do      for opt in "" "-s"; do
740        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry        $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry
741        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 738  if [ $do20 = yes ] ; then Line 750  if [ $do20 = yes ] ; then
750    fi    fi
751  fi  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
767          $cf $testdata/testoutput21 testtry
768          if [ $? != 0 ] ; then exit 1; fi
769        else exit 1
770        fi
771        echo "  OK"
772      fi
773    fi
774    
775    # Tests for reloads with 16-bit library (UTF-16 support)
776    
777    if [ $do22 = yes ] ; then
778      echo "Test 22: reloads for the 16-bit library with UTF-16 support"
779      if [ "$bits" = "8" ] ; then
780        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
786        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
790          $cf $testdata/testoutput22 testtry
791          if [ $? != 0 ] ; then exit 1; fi
792        else exit 1
793        fi
794        echo "  OK"
795      fi
796    fi
797    
798  # End of loop for 8-bit/16-bit tests  # End of loop for 8-bit/16-bit tests
799  done  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.836  
changed lines
  Added in v.912

  ViewVC Help
Powered by ViewVC 1.1.5