diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-07-02 15:20:59 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-07-02 15:20:59 +0000 |
commit | 5c7a0c52f657f9ee5670cddc9466e239243c9b18 (patch) | |
tree | b5e2b3ffe768624a719d31485a06fd83f31f4fde /RunTest | |
parent | 477829e693c6a38cc3443ea90b2dacb19a2eddfc (diff) | |
download | pcre-5c7a0c52f657f9ee5670cddc9466e239243c9b18.tar.gz |
Fix two study bugs concerned with minimum subject lengths; add features to
pcretest so that all tests can be run with or without study; adjust tests so
that this happens.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@612 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunTest')
-rwxr-xr-x | RunTest | 227 |
1 files changed, 130 insertions, 97 deletions
@@ -1,6 +1,14 @@ #! /bin/sh -# Run PCRE tests. +# Run the PCRE tests using the pcretest program. All tests are now run both +# with and without -s, to ensure that everything is tested with and without +# studying. However, there are some tests that produce different output after +# studying, typically when we are tracing the actual matching process (for +# example, using auto-callouts). In these few cases, the tests are duplicated +# in the files, one with /S to force studying always, and one with /SS to force +# *not* studying always. The use of -s doesn't then make any difference to +# their output. There is also one test which compiles invalid UTF-8 with the +# UTF-8 check turned off for which studying is disabled with /SS. valgrind= @@ -137,33 +145,37 @@ echo PCRE C library tests if [ $do1 = yes ] ; then echo "Test 1: main functionality (Compatible with Perl >= 5.8)" - $valgrind ./pcretest -q $testdata/testinput1 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput1 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput1 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput1 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 # PCRE tests that are not Perl-compatible - API, errors, internals if [ $do2 = yes ] ; then echo "Test 2: API, errors, internals, and non-Perl stuff" - $valgrind ./pcretest -q $testdata/testinput2 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput2 testtry - if [ $? != 0 ] ; then exit 1; fi - else - echo " " - echo "** Test 2 requires a lot of stack. If it has crashed with a" - echo "** segmentation fault, it may be that you do not have enough" - echo "** stack available by default. Please see the 'pcrestack' man" - echo "** page for a discussion of PCRE's stack usage." - echo " " - exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput2 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput2 testtry + if [ $? != 0 ] ; then exit 1; fi + else + echo " " + echo "** Test 2 requires a lot of stack. If it has crashed with a" + echo "** segmentation fault, it may be that you do not have enough" + echo "** stack available by default. Please see the 'pcrestack' man" + echo "** page for a discussion of PCRE's stack usage." + echo " " + exit 1 + fi + if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi + done fi # Locale-specific tests, provided that either the "fr_FR" or the "french" @@ -191,19 +203,22 @@ if [ $do3 = yes ] ; then if [ "$locale" != "" ] ; then echo "Test 3: locale-specific features (using '$locale' locale)" - $valgrind ./pcretest -q $infile testtry - if [ $? = 0 ] ; then - $cf $outfile testtry - if [ $? != 0 ] ; then - echo " " - echo "Locale test did not run entirely successfully." - echo "This usually means that there is a problem with the locale" - echo "settings rather than a bug in PCRE." - else - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $infile testtry + if [ $? = 0 ] ; then + $cf $outfile testtry + if [ $? != 0 ] ; then + echo " " + echo "Locale test did not run entirely successfully." + echo "This usually means that there is a problem with the locale" + echo "settings rather than a bug in PCRE." + break; + else + if [ "$opt" = "-s" ] ; then echo "OK with study" ; else echo "OK"; fi + fi + else exit 1 fi - else exit 1 - fi + done else echo "Cannot test locale-specific features - neither the 'fr_FR' nor the" echo "'french' locale exists, or the \"locale\" command is not available" @@ -216,70 +231,82 @@ fi if [ $do4 = yes ] ; then echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" - $valgrind ./pcretest -q $testdata/testinput4 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput4 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput4 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput4 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 if [ $do5 = yes ] ; then echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" - $valgrind ./pcretest -q $testdata/testinput5 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput5 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput5 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput5 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 if [ $do6 = yes ] ; then echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" - $valgrind ./pcretest -q $testdata/testinput6 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput6 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput6 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput6 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 # Tests for DFA matching support if [ $do7 = yes ] ; then echo "Test 7: DFA matching" - $valgrind ./pcretest -q -dfa $testdata/testinput7 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput7 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput7 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 if [ $do8 = yes ] ; then echo "Test 8: DFA matching with UTF-8" - $valgrind ./pcretest -q -dfa $testdata/testinput8 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput8 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput8 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 if [ $do9 = yes ] ; then echo "Test 9: DFA matching with Unicode properties" - $valgrind ./pcretest -q -dfa $testdata/testinput9 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput9 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput9 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 # Test of internal offsets and code sizes. This test is run only when there @@ -290,39 +317,45 @@ fi if [ $do10 = yes ] ; then echo "Test 10: Internal offsets and code size tests" - $valgrind ./pcretest -q $testdata/testinput10 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput10 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput10 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput10 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 # Test of Perl >= 5.10 features if [ $do11 = yes ] ; then echo "Test 11: Features from Perl >= 5.10" - $valgrind ./pcretest -q $testdata/testinput11 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput11 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput11 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput11 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 # Test non-Perl-compatible Unicode property support if [ $do12 = yes ] ; then echo "Test 12: API, internals, and non-Perl stuff for Unicode property support" - $valgrind ./pcretest -q $testdata/testinput12 testtry - if [ $? = 0 ] ; then - $cf $testdata/testoutput12 testtry - if [ $? != 0 ] ; then exit 1; fi - else exit 1 - fi - echo "OK" + for opt in "" "-s"; do + $valgrind ./pcretest -q $opt $testdata/testinput12 testtry + if [ $? = 0 ] ; then + $cf $testdata/testoutput12 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 # End |