diff options
Diffstat (limited to 'RunTest')
-rwxr-xr-x | RunTest | 129 |
1 files changed, 112 insertions, 17 deletions
@@ -18,7 +18,10 @@ # two tests for JIT-specific features, one to be run when JIT support is # available, and one when it is not. -# 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 +# possible to select which to test by the arguments -8 or -16. + +# Other arguments for this script can be individual test numbers, or the word # "valgrind", or "sim" followed by an argument to run cross-compiled # executables under a simulator, for example: # @@ -26,6 +29,8 @@ valgrind= sim= +arg8= +arg16= # Select which tests to run; for those that are explicitly requested, check # that the necessary optional facilities are available. @@ -45,6 +50,8 @@ do12=no do13=no do14=no do15=no +do16=no +do17=no while [ $# -gt 0 ] ; do case $1 in @@ -63,6 +70,10 @@ while [ $# -gt 0 ] ; do 13) do13=yes;; 14) do14=yes;; 15) do15=yes;; + 16) do16=yes;; + 17) do17=yes;; + -8) arg8=yes;; + -16) arg16=yes;; valgrind) valgrind="valgrind -q --smc-check=all";; sim) shift; sim=$1;; *) echo "Unknown test number $1"; exit 1;; @@ -107,12 +118,26 @@ $sim ./pcretest -C | $sim ./pcregrep '8-bit and 16-bit support' >/dev/null if [ $? -eq 0 ] ; then test8= test16=-16 + if [ "$arg8" = yes -a "$arg16" != yes ] ; then + test16=skip + fi + if [ "$arg16" = yes -a "$arg8" != yes ] ; then + test8=skip + fi else $sim ./pcretest -C | $sim ./pcregrep '8-bit support' >/dev/null if [ $? -eq 0 ] ; then + if [ "$arg16" = yes ] ; then + echo "Cannot run 16-bit library tests: 16-bit library not compiled" + exit 1 + fi test8= test16=skip else + if [ "$arg8" = yes ] ; then + echo "Cannot run 8-bit library tests: 8-bit library not compiled" + exit 1 + fi test8=skip test16=-16 fi @@ -135,6 +160,20 @@ if [ $jit -ne 0 ] ; then jitopt=-s+ fi +if [ "$test8" = skip ] ; then + if [ $do17 = yes ] ; then + echo "Can't run test 17 because the 8-bit library is not built" + exit 1 + fi +fi + +if [ "$test16" = skip ] ; then + if [ $do16 = yes ] ; then + echo "Can't run test 16 because the 16-bit library is not built" + exit 1 + fi +fi + if [ $utf -eq 0 ] ; then if [ $do4 = yes ] ; then echo "Can't run test 4 because UTF support is not configured" @@ -152,6 +191,12 @@ if [ $utf -eq 0 ] ; then echo "Can't run test 12 because UTF support is not configured" exit 1 fi + if [ $do16 = yes ] ; then + echo "Can't run test 16 because UTF support is not configured" + fi + if [ $do17 = yes ] ; then + echo "Can't run test 17 because UTF support is not configured" + fi fi if [ $ucp -eq 0 ] ; then @@ -198,7 +243,8 @@ fi if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \ - $do13 = no -a $do14 = no -a $do15 = no ] ; then + $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \ + $do17 = no ] ; then do1=yes do2=yes do3=yes @@ -214,6 +260,8 @@ if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ do13=yes do14=yes do15=yes + do16=yes + do17=yes fi # Show which release and which test data @@ -226,8 +274,8 @@ for bmode in "$test8" "$test16"; do case "$bmode" in skip) continue;; -16) if [ "$test8" != "skip" ] ; then echo ""; fi - echo "---- Testing 16-bit library ----"; echo "";; - *) echo "---- Testing 8-bit library ----"; echo "";; + bits=16; echo "---- Testing 16-bit library ----"; echo "";; + *) bits=8; echo "---- Testing 8-bit library ----"; echo "";; esac # Primary test, compatible with JIT and all versions of Perl >= 5.8 @@ -251,7 +299,7 @@ fi # PCRE tests that are not JIT or Perl-compatible: API, errors, internals if [ $do2 = yes ] ; then - echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-8/16)" + echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)" for opt in "" "-s" $jitopt; do $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry if [ $? = 0 ] ; then @@ -336,9 +384,9 @@ fi # Additional tests for UTF support if [ $do4 = yes ] ; then - echo "Test 4: UTF-8/16 support (Compatible with Perl >= 5.8)" + echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.8)" if [ $utf -eq 0 ] ; then - echo " Skipped because UTF support is not available" + echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry @@ -356,9 +404,9 @@ if [ $do4 = yes ] ; then fi if [ $do5 = yes ] ; then - echo "Test 5: API, internals, and non-Perl stuff for UTF-8/16 support" + echo "Test 5: API, internals, and non-Perl stuff for UTF-$bits support" if [ $utf -eq 0 ] ; then - echo " Skipped because UTF support is not available" + echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry @@ -411,9 +459,9 @@ if [ $do7 = yes ] ; then fi if [ $do8 = yes ] ; then - echo "Test 8: DFA matching with UTF-8 or UTF-16" + echo "Test 8: DFA matching with UTF-$bits" if [ $utf -eq 0 ] ; then - echo " Skipped because UTF support is not available" + echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s"; do $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry @@ -469,10 +517,10 @@ if [ $do10 = yes ] ; then fi fi -# Test of Perl >= 5.10 features without UTF8 support +# Test of Perl >= 5.10 features without UTF support if [ $do11 = yes ] ; then - echo "Test 11: Features from Perl >= 5.10 without UTF8 support" + echo "Test 11: Features from Perl >= 5.10 without UTF-$bits support" for opt in "" "-s" $jitopt; do $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry if [ $? = 0 ] ; then @@ -487,12 +535,12 @@ if [ $do11 = yes ] ; then done fi -# Test of Perl >= 5.10 features with UTF8 support +# Test of Perl >= 5.10 features with UTF support if [ $do12 = yes ] ; then - echo "Test 12: Features from Perl >= 5.10 with UTF-8 or UTF-16 support" + echo "Test 12: Features from Perl >= 5.10 with UTF-$bits support" if [ $utf -eq 0 ] ; then - echo " Skipped because UTF support is not available" + echo " Skipped because UTF-$bits support is not available" else for opt in "" "-s" $jitopt; do $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput12 testtry @@ -565,8 +613,55 @@ if [ $do15 = yes ] ; then fi fi -# End of loop for 8-bit/16-bit tests +# Tests for 16-bit-specific features (needs UTF-8 support) + +if [ $do16 = yes ] ; then + echo "Test 16: specials for the 16-bit library" + if [ "$bits" = "8" ] ; then + echo " Skipped when running 8-bit tests" + elif [ $utf -eq 0 ] ; then + echo " Skipped because UTF-$bits support is not available" + else + for opt in "" "-s" $jitopt; do + $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput16 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + if [ "$opt" = "-s" ] ; then echo " OK with study" + elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" + else echo " OK" + fi + done + fi +fi + +# Tests for 8-bit-specific features (needs UTF-8 support) + +if [ $do17 = yes ] ; then + echo "Test 17: specials for the 8-bit library" + if [ "$bits" = "16" ] ; then + echo " Skipped when running 16-bit tests" + elif [ $utf -eq 0 ] ; then + echo " Skipped because UTF-$bits support is not available" + else + for opt in "" "-s" $jitopt; do + $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput17 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + if [ "$opt" = "-s" ] ; then echo " OK with study" + elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" + else echo " OK" + fi + done + fi +fi +# End of loop for 8-bit/16-bit tests done # End |