diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-08-05 16:51:32 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-08-05 16:51:32 +0000 |
commit | f4420ec8a64f207f9cfda81cf4331412e339d04b (patch) | |
tree | c793dc77410487e13f1ee0aa56c84b9dfbe199ea /RunTest | |
parent | 8638e05d8fc1616e33225acf157a2e1bbb09e973 (diff) | |
download | pcre2-f4420ec8a64f207f9cfda81cf4331412e339d04b.tar.gz |
All tests except JIT and save/reload are implemented.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@37 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'RunTest')
-rwxr-xr-x | RunTest | 481 |
1 files changed, 169 insertions, 312 deletions
@@ -58,22 +58,18 @@ title5B=" and UCP support" title6="Test 6: DFA matching main non-UTF, non-UCP functionality" title7A="Test 7: DFA matching with UTF" title7B=" and Unicode property support" -#title11="Test 11: Internal offsets and code size tests" +title8="Test 8: Internal offsets and code size tests" +title9="Test 9: Specials for the basic 8-bit library" +title10="Test 10: Specials for the 8-bit library with UTF-8 and UCP support" +title11="Test 11: Specials for the basic 16-bit and 32-bit libraries" +title12="Test 12: Specials for the 16-bit and 32-bit libraries UTF and UCP support" +title13="Test 13: DFA specials for the basic 16-bit and 32-bit libraries" + #title12="Test 12: JIT-specific features (when JIT is available)" #title13="Test 13: JIT-specific features (when JIT is not available)" -#title14="Test 14: Specials for the basic 8-bit library" -#title15="Test 15: Specials for the 8-bit library with UTF-8 support" -#title16="Test 16: Specials for the 8-bit library with Unicode propery support" -#title17="Test 17: Specials for the basic 16/32-bit library" -#title18="Test 18: Specials for the 16/32-bit library with UTF-16/32 support" -#title19="Test 19: Specials for the 16/32-bit library with Unicode property support" -#title20="Test 20: DFA specials for the basic 16/32-bit library" + #title21="Test 21: Reloads for the basic 16/32-bit library" #title22="Test 22: Reloads for the 16/32-bit library with UTF-16/32 support" -#title23="Test 23: Specials for the 16-bit library" -#title24="Test 24: Specials for the 16-bit library with UTF-16 support" -#title25="Test 25: Specials for the 32-bit library" -#title26="Test 26: Specials for the 32-bit library with UTF-32 support" maxtest=2 @@ -85,12 +81,12 @@ if [ $# -eq 1 -a "$1" = "list" ]; then echo $title5A $title5B echo $title6 echo $title7A $title7B -# echo $title8 -# echo $title9 -# echo $title10 -# echo $title11 -# echo $title12 -# echo $title13 + echo $title8 + echo $title9 + echo $title10 + echo $title11 + echo $title12 + echo $title13 # echo $title14 # echo $title15 # echo $title16 @@ -100,10 +96,6 @@ if [ $# -eq 1 -a "$1" = "list" ]; then # echo $title20 # echo $title21 # echo $title22 -# echo $title23 -# echo $title24 -# echo $title25 -# echo $title26 exit 0 fi @@ -178,12 +170,12 @@ do4=no do5=no do6=no do7=no -#do8=no -#do9=no -#do10=no -#do11=no -#do12=no -#do13=no +do8=no +do9=no +do10=no +do11=no +do12=no +do13=no #do14=no #do15=no #do16=no @@ -193,10 +185,6 @@ do7=no #do20=no #do21=no #do22=no -#do23=no -#do24=no -#do25=no -#do26=no while [ $# -gt 0 ] ; do case $1 in @@ -207,12 +195,12 @@ while [ $# -gt 0 ] ; do 5) do5=yes;; 6) do6=yes;; 7) do7=yes;; -# 8) do8=yes;; -# 9) do9=yes;; -# 10) do10=yes;; -# 11) do11=yes;; -# 12) do12=yes;; -# 13) do13=yes;; + 8) do8=yes;; + 9) do9=yes;; + 10) do10=yes;; + 11) do11=yes;; + 12) do12=yes;; + 13) do13=yes;; # 14) do14=yes;; # 15) do15=yes;; # 16) do16=yes;; @@ -222,10 +210,6 @@ while [ $# -gt 0 ] ; do # 20) do20=yes;; # 21) do21=yes;; # 22) do22=yes;; -# 23) do23=yes;; -# 24) do24=yes;; -# 25) do25=yes;; -# 26) do26=yes;; -8) arg8=yes;; -16) arg16=yes;; -32) arg32=yes;; @@ -330,7 +314,7 @@ else fi # UTF support always applies to all bit sizes if both are supported; we can't -# have UTF-8 support without UTF-16 support (for example). +# have UTF-8 support without UTF-16 or UTF-32 support. $sim ./pcre2test -C utf >/dev/null utf=$? @@ -346,14 +330,13 @@ fi # relevant will be automatically skipped. if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ - $do5 = no -a $do6 = no -a $do7 = no \ + $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 \ ]; then -# -a $do8 = no -a \ -# $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \ -# $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \ +# -a $do14 = no -a $do15 = no -a $do16 = no -a \ # $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \ -# $do21 = no -a $do22 = no -a $do23 = no -a $do24 = no -a \ -# $do25 = no -a $do26 = no +# $do21 = no -a $do22 = no do1=yes do2=yes @@ -362,12 +345,12 @@ if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ do5=yes do6=yes do7=yes -# do8=yes -# do9=yes -# do10=yes -# do11=yes -# do12=yes -# do13=yes + do8=yes + do9=yes + do10=yes + do11=yes + do12=yes + do13=yes # do14=yes # do15=yes # do16=yes @@ -377,10 +360,6 @@ if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ # do20=yes # do21=yes # do22=yes -# do23=yes -# do24=yes -# do25=yes -# do26=yes fi # Handle any explicit skips at this stage, so that an argument list may consist @@ -584,32 +563,137 @@ if [ $do7 = yes ] ; then fi fi -## Test of internal offsets and code sizes. This test is run only when there -## is Unicode property support and the link size is 2. The actual tests are -## mostly the same as in some of the above, but in this test we inspect some -## offsets and sizes that require a known link size. This is a doublecheck for -## the maintainer, just in case something changes unexpectely. The output from -## this test is not the same in 8-bit and 16-bit modes. -# -#if [ $do11 = yes ] ; then -# echo $title11 -# if [ $link_size -ne 2 ] ; then -# echo " Skipped because link size is not 2" -# elif [ $ucp -eq 0 ] ; then -# echo " Skipped because Unicode property support is not available" -# else -# for opt in "" "-s"; do -# $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput11 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput11-$bits testtry -# if [ $? != 0 ] ; then exit 1; fi -# else exit 1 -# fi -# if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi -# done -# fi -#fi -# +# Test of internal offsets and code sizes. This test is run only when there +# is UTF/UCP support and the link size is 2. The actual tests are +# mostly the same as in some of the above, but in this test we inspect some +# offsets and sizes that require a known link size. This is a doublecheck for +# the maintainer, just in case something changes unexpectely. The output from +# this test is different in 8-bit, 16-bit, and 32-bit modes, so there are +# mode-specific output files. + +if [ $do8 = yes ] ; then + echo $title8 + if [ $link_size -ne 2 ] ; then + echo " Skipped because link size is not 2" + elif [ $utf -eq 0 ] ; then + echo " Skipped because UTF-$bits support is not available" + else + $sim $valgrind ./pcre2test -q $bmode $testdata/testinput8 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput8-$bits testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo " OK" + fi +fi + +# Tests for 8-bit-specific features + +if [ "$do9" = yes ] ; then + echo $title9 + if [ "$bits" = "16" -o "$bits" = "32" ] ; then + echo " Skipped when running 16/32-bit tests" + else + for opt in "" $jitopt; do + $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput9 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput9 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + if [ "$opt" = "-jit" ] ; then echo " OK with JIT" + else echo " OK" + fi + done + fi +fi + +# Tests for UTF-8 and UCP 8-bit-specific features + +if [ "$do10" = yes ] ; then + echo $title10 + if [ "$bits" = "16" -o "$bits" = "32" ] ; then + echo " Skipped when running 16/32-bit tests" + elif [ $utf -eq 0 ] ; then + echo " Skipped because UTF-$bits support is not available" + else + for opt in "" $jitopt; do + $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput10 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput10 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + if [ "$opt" = "-jit" ] ; then echo " OK with JIT" + else echo " OK" + fi + done + fi +fi + +# Tests for 16-bit and 32-bit features. Output is different for the two widths. + +if [ $do11 = yes ] ; then + echo $title11 + if [ "$bits" = "8" ] ; then + echo " Skipped when running 8-bit tests" + else + for opt in "" $jitopt; do + $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput11 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput11-$bits testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + if [ "$opt" = "-jit" ] ; then echo " OK with JIT" + else echo " OK" + fi + done + fi +fi + +# Tests for 16-bit and 32-bit features with UTF-16/32 and UCP support. Output +# is different for the two widths. + +if [ $do12 = yes ] ; then + echo $title12 + 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 "" $jitopt; do + $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput12 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput12-$bits testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + if [ "$opt" = "-jit" ] ; then echo " OK with JIT" + else echo " OK" + fi + done + fi +fi + +# Tests for 16/32-bit-specific features in DFA non-UTF modes + +if [ $do13 = yes ] ; then + echo $title13 + if [ "$bits" = "8" ] ; then + echo " Skipped when running 8-bit tests" + else + $sim $valgrind ./pcre2test -q $bmode $testdata/testinput13 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput13 testtry + if [ $? != 0 ] ; then exit 1; fi + else exit 1 + fi + echo " OK" + fi +fi + ## Test JIT-specific features when JIT is available # #if [ $do12 = yes ] ; then @@ -644,169 +728,6 @@ fi # fi #fi # -## Tests for 8-bit-specific features -# -#if [ "$do14" = yes ] ; then -# echo $title14 -# if [ "$bits" = "16" -o "$bits" = "32" ] ; then -# echo " Skipped when running 16/32-bit tests" -# else -# cp -f $testdata/saved16 testsaved16 -# cp -f $testdata/saved32 testsaved32 -# for opt in "" "-s" $jitopt; do -# $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput14 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput14 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 [ "$do15" = yes ] ; then -# echo $title15 -# if [ "$bits" = "16" -o "$bits" = "32" ] ; then -# echo " Skipped when running 16/32-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 ./pcre2test -q $bmode $opt $testdata/testinput15 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput15 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 (Unicode property support) -# -#if [ $do16 = yes ] ; then -# echo $title16 -# if [ "$bits" = "16" -o "$bits" = "32" ] ; then -# echo " Skipped when running 16/32-bit tests" -# elif [ $ucp -eq 0 ] ; then -# echo " Skipped because Unicode property support is not available" -# else -# for opt in "" "-s" $jitopt; do -# $sim $valgrind ./pcre2test -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 16/32-bit-specific features -# -#if [ $do17 = yes ] ; then -# echo $title17 -# if [ "$bits" = "8" ] ; then -# echo " Skipped when running 8-bit tests" -# else -# for opt in "" "-s" $jitopt; do -# $sim $valgrind ./pcre2test -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 -# -## Tests for 16/32-bit-specific features (UTF-16/32 support) -# -#if [ $do18 = yes ] ; then -# echo $title18 -# 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 ./pcre2test -q $bmode $opt $testdata/testinput18 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput18-$bits 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 16/32-bit-specific features (Unicode property support) -# -#if [ $do19 = yes ] ; then -# echo $title19 -# if [ "$bits" = "8" ] ; then -# echo " Skipped when running 8-bit tests" -# elif [ $ucp -eq 0 ] ; then -# echo " Skipped because Unicode property support is not available" -# else -# for opt in "" "-s" $jitopt; do -# $sim $valgrind ./pcre2test -q $bmode $opt $testdata/testinput19 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput19 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 16/32-bit-specific features in DFA non-UTF-16/32 mode -# -#if [ $do20 = yes ] ; then -# echo $title20 -# if [ "$bits" = "8" ] ; then -# echo " Skipped when running 8-bit tests" -# else -# for opt in "" "-s"; do -# $sim $valgrind ./pcre2test -q $bmode $opt -dfa $testdata/testinput20 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput20 testtry -# if [ $? != 0 ] ; then exit 1; fi -# else exit 1 -# fi -# if [ "$opt" = "-s" ] ; then echo " OK with study" -# else echo " OK" -# fi -# done -# fi -#fi -# ## Tests for reloads with 16/32-bit library # #if [ $do21 = yes ] ; then @@ -855,70 +776,6 @@ fi # echo " OK" # fi #fi -# -#if [ $do23 = yes ] ; then -# echo $title23 -# if [ "$bits" = "8" -o "$bits" = "32" ] ; then -# echo " Skipped when running 8/32-bit tests" -# else -# $sim $valgrind ./pcre2test -q $bmode $testdata/testinput23 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput23 testtry -# if [ $? != 0 ] ; then exit 1; fi -# else exit 1 -# fi -# echo " OK" -# fi -#fi -# -#if [ $do24 = yes ] ; then -# echo $title24 -# if [ "$bits" = "8" -o "$bits" = "32" ] ; then -# echo " Skipped when running 8/32-bit tests" -# elif [ $utf -eq 0 ] ; then -# echo " Skipped because UTF-$bits support is not available" -# else -# $sim $valgrind ./pcre2test -q $bmode $testdata/testinput24 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput24 testtry -# if [ $? != 0 ] ; then exit 1; fi -# else exit 1 -# fi -# echo " OK" -# fi -#fi -# -#if [ $do25 = yes ] ; then -# echo $title25 -# if [ "$bits" = "8" -o "$bits" = "16" ] ; then -# echo " Skipped when running 8/16-bit tests" -# else -# $sim $valgrind ./pcre2test -q $bmode $testdata/testinput25 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput25 testtry -# if [ $? != 0 ] ; then exit 1; fi -# else exit 1 -# fi -# echo " OK" -# fi -#fi -# -#if [ $do26 = yes ] ; then -# echo $title26 -# if [ "$bits" = "8" -o "$bits" = "16" ] ; then -# echo " Skipped when running 8/16-bit tests" -# elif [ $utf -eq 0 ] ; then -# echo " Skipped because UTF-$bits support is not available" -# else -# $sim $valgrind ./pcre2test -q $bmode $testdata/testinput26 testtry -# if [ $? = 0 ] ; then -# $cf $testdata/testoutput26 testtry -# if [ $? != 0 ] ; then exit 1; fi -# else exit 1 -# fi -# echo " OK" -# fi -#fi # End of loop for 8/16/32-bit tests done |