Lines Matching +full:valgrind +full:-

5 # selected, depending on which build-time options were used.
8 # JIT, unless "-nojit" is given on the command line. There are also two tests
9 # for JIT-specific features, one to be run when JIT support is available
10 # (unless "-nojit" is specified), and one when it is not.
12 # Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
13 # possible to select which to test by giving "-8", "-16" or "-32" on the
16 # As well as "-nojit", "-8", "-16", and "-32", arguments for this script are
17 # individual test numbers, ranges of tests such as 3-6 or 3- (meaning 3 to the
18 # end), or a number preceded by ~ to exclude a test. For example, "3-15 ~10"
27 # Other arguments can be one of the words "-valgrind", "-valgrind-log", or
28 # "-sim" followed by an argument to run cross-compiled executables under a
31 # RunTest 3 -sim "qemu-arm -s 8388608"
33 # For backwards compatibility, -nojit, -valgrind, -valgrind-log, and -sim may
34 # be given without the leading "-" character.
36 # When PCRE2 is compiled by clang with -fsanitize arguments, some tests need
38 # set at runtime, -bigstack sets a gigantic stack.
52 # of them are modified (e.g. with -8 or -16) when used in the actual tests.
55 title1="Test 1: Main non-UTF, non-UCP functionality (compatible with Perl >= 5.10)"
56 title2="Test 2: API, errors, internals and non-Perl stuff"
57 title3="Test 3: Locale-specific features"
60 title5A="Test 5: API, internals, and non-Perl stuff for UTF"
62 title6="Test 6: DFA matching main non-UTF, non-UCP functionality"
66 title9="Test 9: Specials for the basic 8-bit library"
67 title10="Test 10: Specials for the 8-bit library with UTF-8 and UCP support"
68 title11="Test 11: Specials for the basic 16-bit and 32-bit libraries"
69 title12="Test 12: Specials for the 16-bit and 32-bit libraries UTF and UCP support"
70 title13="Test 13: DFA specials for the basic 16-bit and 32-bit libraries"
72 title15="Test 15: Non-JIT limits and other non-JIT tests"
73 title16="Test 16: JIT-specific features when JIT is not available"
74 title17="Test 17: JIT-specific features when JIT is available"
81 title24="Test 24: Non-UTF pattern conversion tests"
85 if [ $# -eq 1 -a "$1" = "list" ]; then
116 # have a diff that lacks a -u option. Try to deal with this.
119 diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
123 if [ -n "$srcdir" -a -d "$srcdir" ] ; then
125 elif [ -d "./testdata" ] ; then
127 elif [ -d "../testdata" ] ; then
135 # ------ Function to check results of a test -------
141 # $3 the $opt value (empty, -jit, or -dfa)
147 if [ $1 -ne 0 ] ; then
148 echo "** pcre2test failed - check testtry"
152 -jit) with=" with JIT";;
153 -dfa) with=" with DFA";;
166 # ------ Function to run and check a special pcre2test arguments test -------
170 $valgrind $vjs ./pcre2test $1 >>testtry
171 if [ $? -ne 0 ] ; then
172 echo "** pcre2test $1 failed - check testtry"
178 # ------ Special EBCDIC Test -------
180 if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
181 $valgrind ./pcre2test -C ebcdic >/dev/null
183 if [ $ebcdic -ne 1 ] ; then
187 for opt in "" "-dfa"; do
188 ./pcre2test -q $opt $testdata/testinputEBC >testtry
195 # ------ Normal Tests ------
206 valgrind=
209 # This is in case the caller has set aliases (as I do - PH)
242 while [ $# -gt 0 ] ; do
270 -8) arg8=yes;;
271 -16) arg16=yes;;
272 -32) arg32=yes;;
273 bigstack|-bigstack) bigstack=yes;;
274 nojit|-nojit) nojit=yes;;
275 sim|-sim) shift; sim=$1;;
276 valgrind|-valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all-non-file";;
277valgrind-log|-valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --
279 if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
280 skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
285 *-*)
286 if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
287 tf=`expr "$1" : '\([0-9]*\)'`
288 tt=`expr "$1" : '.*-\([0-9]*\)'`
308 $sim ./pcre2test -C linksize >/dev/null
310 if [ $link_size -lt 2 ] ; then
314 if [ $link_size -gt 4 ] ; then
319 # If it is possible to set the system stack size and -bigstack was given,
322 $sim ./pcre2test -S 64 /dev/null /dev/null
323 if [ $? -eq 0 -a "$bigstack" != "" ] ; then
324 setstack="-S 64"
329 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
332 $sim ./pcre2test -C pcre2-8 >/dev/null
334 $sim ./pcre2test -C pcre2-16 >/dev/null
336 $sim ./pcre2test -C pcre2-32 >/dev/null
341 $sim ./pcre2test -C backslash-C >/dev/null
353 if [ $support8 -ne 0 ] ; then
354 test8=-8
356 if [ $support16 -ne 0 ] ; then
357 test16=-16
359 if [ $support32 -ne 0 ] ; then
360 test32=-32
367 if [ $support8 -eq 0 ] ; then
368 echo "Cannot run 8-bit library tests: 8-bit library not compiled"
371 test8=-8
374 if [ $support16 -eq 0 ] ; then
375 echo "Cannot run 16-bit library tests: 16-bit library not compiled"
378 test16=-16
381 if [ $support32 -eq 0 ] ; then
382 echo "Cannot run 32-bit library tests: 32-bit library not compiled"
385 test32=-32
390 # sizes if both are supported; we can't have UTF-8 support without UTF-16 or
391 # UTF-32 support.
393 $sim ./pcre2test -C unicode >/dev/null
396 # When JIT is used with valgrind, we need to set up valgrind suppressions as
397 # otherwise there are a lot of false positive valgrind reports when the
401 $sim ./pcre2test -C jit >/dev/null
403 if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
404 jitopt=-jit
405 if [ "$valgrind" != "" ] ; then
406 vjs="--suppressions=$testdata/valgrind-jit.supp"
413 if [ $do0 = no -a $do1 = no -a $do2 = no -a $do3 = no -a \
414 $do4 = no -a $do5 = no -a $do6 = no -a $do7 = no -a \
415 $do8 = no -a $do9 = no -a $do10 = no -a $do11 = no -a \
416 $do12 = no -a $do13 = no -a $do14 = no -a $do15 = no -a \
417 $do16 = no -a $do17 = no -a $do18 = no -a $do19 = no -a \
418 $do20 = no -a $do21 = no -a $do22 = no -a $do23 = no -a \
419 $do24 = no -a $do25 = no \
464 -16) if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
465 bits=16; echo "---- Testing 16-bit library ----"; echo "";;
466 -32) if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
467 bits=32; echo "---- Testing 32-bit library ----"; echo "";;
468 -8) bits=8; echo "---- Testing 8-bit library ----"; echo "";;
480 checkspecial '-C'
481 checkspecial '--help'
482 checkspecial '-S 1 -t 10 testSinput'
486 # Primary non-UTF test, compatible with JIT and all versions of Perl >= 5.8
491 $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput1 testtry
496 # PCRE2 tests that are not Perl-compatible: API, errors, internals. We copy
500 echo $title2 "(excluding UTF-$bits)"
503 $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput2 testtry
506 …$sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -70,-62,-2,-1,0,100,101,191,200 >>te…
514 # Locale-specific tests, provided that either the "fr_FR", "fr_CA", "french"
515 # or "fr" locale is available. The first two are Unix-like standards; the
523 # In some environments locales that are listed by the "locale -a"
529 locale -a | grep "^$loc\$" >/dev/null
530 if [ $? -eq 0 ] ; then
532 $sim $valgrind ./pcre2test -q $bmode | \
534 if [ $? -ne 0 ] ; then
559 $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $infile testtry
562 -jit) with=" with JIT";;
581 echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr_CA',"
591 echo ${title4A}-${bits}${title4B}
592 if [ $utf -eq 0 ] ; then
593 echo " Skipped because UTF-$bits support is not available"
596 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput4 testtry
603 echo ${title5A}-${bits}$title5B
604 if [ $utf -eq 0 ] ; then
605 echo " Skipped because UTF-$bits support is not available"
608 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput5 testtry
618 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput6 testtry
623 echo ${title7A}-${bits}$title7B
624 if [ $utf -eq 0 ] ; then
625 echo " Skipped because UTF-$bits support is not available"
627 $sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput7 testtry
636 # The output from this test is different in 8-bit, 16-bit, and 32-bit modes
642 if [ $utf -eq 0 ] ; then
643 echo " Skipped because UTF-$bits support is not available"
645 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput8 testtry
646 checkresult $? 8-$bits-$link_size ""
650 # Tests for 8-bit-specific features
654 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
655 echo " Skipped when running 16/32-bit tests"
658 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput9 testtry
664 # Tests for UTF-8 and UCP 8-bit-specific features
668 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
669 echo " Skipped when running 16/32-bit tests"
670 elif [ $utf -eq 0 ] ; then
671 echo " Skipped because UTF-$bits support is not available"
674 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput10 testtry
680 # Tests for 16-bit and 32-bit features. Output is different for the two widths.
685 echo " Skipped when running 8-bit tests"
688 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput11 testtry
689 checkresult $? 11-$bits "$opt"
694 # Tests for 16-bit and 32-bit features with UTF-16/32 and UCP support. Output
700 echo " Skipped when running 8-bit tests"
701 elif [ $utf -eq 0 ] ; then
702 echo " Skipped because UTF-$bits support is not available"
705 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput12 testtry
706 checkresult $? 12-$bits "$opt"
711 # Tests for 16/32-bit-specific features in DFA non-UTF modes
716 echo " Skipped when running 8-bit tests"
718 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput13 testtry
727 if [ $utf -eq 0 ] ; then
728 echo " Skipped because UTF-$bits support is not available"
730 $sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput14 testtry
731 checkresult $? 14-$bits ""
735 # Test non-JIT match and recursion limits
739 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput15 testtry
743 # Test JIT-specific features when JIT is not available
747 if [ $jit -ne 0 ] ; then
750 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput16 testtry
755 # Test JIT-specific features when JIT is available
759 if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
762 $sim $valgrind $vjs ./pcre2test -q $setstack $bmode $testdata/testinput17 testtry
767 # Tests for the POSIX interface without UTF/UCP (8-bit only)
771 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
772 echo " Skipped when running 16/32-bit tests"
774 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput18 testtry
779 # Tests for the POSIX interface with UTF/UCP (8-bit only)
783 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
784 echo " Skipped when running 16/32-bit tests"
785 elif [ $utf -eq 0 ] ; then
786 echo " Skipped because UTF-$bits support is not available"
788 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput19 testtry
797 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput20 testtry
801 # \C tests without UTF - DFA matching is supported
805 if [ $supportBSC -eq 0 ] ; then
808 for opt in "" $jitopt -dfa; do
809 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput21 testtry
815 # \C tests with UTF - DFA matching is not supported for \C in UTF mode
819 if [ $supportBSC -eq 0 ] ; then
821 elif [ $utf -eq 0 ] ; then
822 echo " Skipped because UTF-$bits support is not available"
825 … $sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput22 testtry
826 checkresult $? 22-$bits "$opt"
835 if [ $supportBSC -ne 0 ] ; then
838 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput23 testtry
843 # Non-UTF pattern conversion tests
847 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput24 testtry
855 if [ $utf -eq 0 ] ; then
856 echo " Skipped because UTF-$bits support is not available"
858 $sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput25 testtry
863 # End of loop for 8/16/32-bit tests
867 rm -f testbtables testSinput test3input testsaved1 testsaved2 test3output test3outputA test3outputB…