3 ###############################################################################
4 # Run the PCRE tests using the pcretest program. The appropriate tests are
5 # selected, depending on which build-time options were used.
7 # All tests are now run both with and without -s, to ensure that everything is
8 # tested with and without studying. However, there are some tests that produce
9 # different output after studying, typically when we are tracing the actual
10 # matching process (for example, using auto-callouts). In these few cases, the
11 # tests are duplicated in the files, one with /S to force studying always, and
12 # one with /SS to force *not* studying always. The use of -s doesn't then make
13 # any difference to their output. There is also one test which compiles invalid
14 # UTF-8 with the UTF-8 check turned off; for this, studying must also be
17 # When JIT support is available, all appropriate tests are also run with -s+ to
18 # test (again, almost) everything with studying and the JIT option, unless
19 # "nojit" is given on the command line. There are also two tests for
20 # JIT-specific features, one to be run when JIT support is available (unless
21 # "nojit" is specified), and one when it is not.
23 # Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
24 # possible to select which to test by giving "-8", "-16" or "-32" on the
27 # As well as "nojit", "-8", "-16", and "-32", arguments for this script are
28 # individual test numbers, ranges of tests such as 3-6 or 3- (meaning 3 to the
29 # end), or a number preceded by ~ to exclude a test. For example, "3-15 ~10"
30 # runs tests 3 to 15, excluding test 10, and just "~10" runs all the tests
31 # except test 10. Whatever order the arguments are in, the tests are always run
34 # The special argument "3S" runs test 3, stopping if it fails. Test 3 is the
35 # locale test, and failure usually means there's an issue with the locale
36 # rather than a bug in PCRE, so normally subsequent tests are run. "3S" is
37 # useful when you want to debug or update the test.
39 # Inappropriate tests are automatically skipped (with a comment to say so): for
40 # example, if JIT support is not compiled, test 12 is skipped, whereas if JIT
41 # support is compiled, test 13 is skipped.
43 # Other arguments can be one of the words "valgrind", "valgrind-log", or "sim"
44 # followed by an argument to run cross-compiled executables under a simulator,
47 # RunTest 3 sim "qemu-arm -s 8388608"
49 # There are two special cases where only one argument is allowed:
51 # If the first and only argument is "ebcdic", the script runs the special
52 # EBCDIC test that can be useful for checking certain EBCDIC features, even
53 # when run in an ASCII environment.
55 # If the script is obeyed as "RunTest list", a list of available tests is
56 # output, but none of them are run.
57 ###############################################################################
59 # Define test titles in variables so that they can be output as a list. Some
60 # of them are modified (e.g. with -8 or -16) when used in the actual tests.
62 title1="Test 1: Main functionality (Compatible with Perl >= 5.10)"
63 title2="Test 2: API, errors, internals, and non-Perl stuff"
64 title3="Test 3: Locale-specific features"
66 title4B=" support (Compatible with Perl >= 5.10)"
67 title5="Test 5: API, internals, and non-Perl stuff for UTF"
68 title6="Test 6: Unicode property support (Compatible with Perl >= 5.10)"
69 title7="Test 7: API, internals, and non-Perl stuff for Unicode property support"
70 title8="Test 8: DFA matching main functionality"
71 title9="Test 9: DFA matching with UTF"
72 title10="Test 10: DFA matching with Unicode properties"
73 title11="Test 11: Internal offsets and code size tests"
74 title12="Test 12: JIT-specific features (when JIT is available)"
75 title13="Test 13: JIT-specific features (when JIT is not available)"
76 title14="Test 14: Specials for the basic 8-bit library"
77 title15="Test 15: Specials for the 8-bit library with UTF-8 support"
78 title16="Test 16: Specials for the 8-bit library with Unicode propery support"
79 title17="Test 17: Specials for the basic 16/32-bit library"
80 title18="Test 18: Specials for the 16/32-bit library with UTF-16/32 support"
81 title19="Test 19: Specials for the 16/32-bit library with Unicode property support"
82 title20="Test 20: DFA specials for the basic 16/32-bit library"
83 title21="Test 21: Reloads for the basic 16/32-bit library"
84 title22="Test 22: Reloads for the 16/32-bit library with UTF-16/32 support"
85 title23="Test 23: Specials for the 16-bit library"
86 title24="Test 24: Specials for the 16-bit library with UTF-16 support"
87 title25="Test 25: Specials for the 32-bit library"
88 title26="Test 26: Specials for the 32-bit library with UTF-32 support"
92 if [ $# -eq 1 -a "$1" = "list" ]; then
94 echo $title2 "(not UTF)"
96 echo $title4A $title4B
122 # Set up a suitable "diff" command for comparison. Some systems
123 # have a diff that lacks a -u option. Try to deal with this.
126 diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
130 if [ -n "$srcdir" -a -d "$srcdir" ] ; then
131 testdata="$srcdir/testdata"
132 elif [ -d "./testdata" ] ; then
134 elif [ -d "../testdata" ] ; then
137 echo "Cannot find the testdata directory"
142 # ------ Special EBCDIC Test -------
144 if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
145 ./pcretest -C ebcdic >/dev/null
147 if [ $ebcdic -ne 1 ] ; then
148 echo "Cannot run EBCDIC tests: EBCDIC support not compiled"
152 for opt in "" "-s" "-dfa" "-s -dfa"; do
153 ./pcretest -q $opt $testdata/testinputEBC >testtry
155 $cf $testdata/testoutputEBC testtry
156 if [ $? != 0 ] ; then exit 1; fi
159 if [ "$opt" = "-s" ] ; then echo " OK with study"
160 elif [ "$opt" = "-dfa" ] ; then echo " OK using DFA"
161 elif [ "$opt" = "-s -dfa" ] ; then echo " OK using DFA with study"
170 # ------ Normal Tests ------
183 # This is in case the caller has set aliases (as I do - PH)
186 # Process options and select which tests to run; for those that are explicitly
187 # requested, check that the necessary optional facilities are available.
216 while [ $# -gt 0 ] ; do
249 valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
250 valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
252 if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
253 skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
255 echo "Unknown option or test selector '$1'"; exit 1
259 if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
260 tf=`expr "$1" : '\([0-9]*\)'`
261 tt=`expr "$1" : '.*-\([0-9]*\)'`
262 if [ "$tt" = "" ] ; then tt=$maxtest; fi
263 if expr \( "$tf" "<" 1 \) \| \( "$tt" ">" "$maxtest" \) >/dev/null; then
264 echo "Invalid test range '$1'"; exit 1
266 while expr "$tf" "<=" "$tt" >/dev/null; do
271 echo "Invalid test range '$1'"; exit 1
274 *) echo "Unknown option or test selector '$1'"; exit 1;;
279 # Find which optional facilities are available.
281 $sim ./pcretest -C linksize >/dev/null
283 if [ $link_size -lt 2 ] ; then
284 echo "Failed to find internal link size"
287 if [ $link_size -gt 4 ] ; then
288 echo "Failed to find internal link size"
292 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
295 $sim ./pcretest -C pcre8 >/dev/null
297 $sim ./pcretest -C pcre16 >/dev/null
299 $sim ./pcretest -C pcre32 >/dev/null
302 # Initialize all bitsizes skipped
308 # If no bitsize arguments, select all that are available
310 if [ "$arg8$arg16$arg32" = "" ] ; then
311 if [ $support8 -ne 0 ] ; then
314 if [ $support16 -ne 0 ] ; then
317 if [ $support32 -ne 0 ] ; then
321 # Select requested bit sizes
324 if [ "$arg8" = yes ] ; then
325 if [ $support8 -eq 0 ] ; then
326 echo "Cannot run 8-bit library tests: 8-bit library not compiled"
331 if [ "$arg16" = yes ] ; then
332 if [ $support16 -eq 0 ] ; then
333 echo "Cannot run 16-bit library tests: 16-bit library not compiled"
338 if [ "$arg32" = yes ] ; then
339 if [ $support32 -eq 0 ] ; then
340 echo "Cannot run 32-bit library tests: 32-bit library not compiled"
347 # UTF support always applies to all bit sizes if both are supported; we can't
348 # have UTF-8 support without UTF-16 support (for example).
350 $sim ./pcretest -C utf >/dev/null
353 $sim ./pcretest -C ucp >/dev/null
357 $sim ./pcretest -C jit >/dev/null
359 if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
361 if [ "$valgrind" != "" ] ; then
362 vjs="--suppressions=$testdata/valgrind-jit.supp"
366 # If no specific tests were requested, select all. Those that are not
367 # relevant will be automatically skipped.
369 if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
370 $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
371 $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
372 $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
373 $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \
374 $do21 = no -a $do22 = no -a $do23 = no -a $do24 = no -a \
375 $do25 = no -a $do26 = no ] ; then
404 # Handle any explicit skips at this stage, so that an argument list may consist
405 # only of explicit skips.
407 for i in $skip; do eval do$i=no; done
409 # Show which release and which test data
412 echo PCRE C library tests using test data from $testdata
413 $sim ./pcretest /dev/null
415 for bmode in "$test8" "$test16" "$test32"; do
418 -16) if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
419 bits=16; echo "---- Testing 16-bit library ----"; echo "";;
420 -32) if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
421 bits=32; echo "---- Testing 32-bit library ----"; echo "";;
422 *) bits=8; echo "---- Testing 8-bit library ----"; echo "";;
425 # Primary test, compatible with JIT and all versions of Perl >= 5.8
427 if [ $do1 = yes ] ; then
429 for opt in "" "-s" $jitopt; do
430 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput1 testtry
432 $cf $testdata/testoutput1 testtry
433 if [ $? != 0 ] ; then exit 1; fi
436 if [ "$opt" = "-s" ] ; then echo " OK with study"
437 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
443 # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
445 if [ $do2 = yes ] ; then
446 echo $title2 "(not UTF-$bits)"
447 for opt in "" "-s" $jitopt; do
448 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput2 testtry
450 $cf $testdata/testoutput2 testtry
451 if [ $? != 0 ] ; then exit 1; fi
454 echo "** Test 2 requires a lot of stack. If it has crashed with a"
455 echo "** segmentation fault, it may be that you do not have enough"
456 echo "** stack available by default. Please see the 'pcrestack' man"
457 echo "** page for a discussion of PCRE's stack usage."
461 if [ "$opt" = "-s" ] ; then echo " OK with study"
462 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
468 # Locale-specific tests, provided that either the "fr_FR" or the "french"
469 # locale is available. The former is the Unix-like standard; the latter is
470 # for Windows. Another possibility is "fr". Unfortunately, different versions
471 # of the French locale give different outputs for some items. This test passes
472 # if the output matches any one of the alternative output files.
474 if [ $do3 = yes ] ; then
475 locale -a | grep '^fr_FR$' >/dev/null
476 if [ $? -eq 0 ] ; then
478 infile=$testdata/testinput3
479 outfile=$testdata/testoutput3
480 outfile2=$testdata/testoutput3A
481 outfile3=$testdata/testoutput3B
485 outfile2=test3outputA
486 outfile3=test3outputB
487 locale -a | grep '^french$' >/dev/null
488 if [ $? -eq 0 ] ; then
490 sed 's/fr_FR/french/' $testdata/testinput3 >test3input
491 sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
492 sed 's/fr_FR/french/' $testdata/testoutput3A >test3outputA
493 sed 's/fr_FR/french/' $testdata/testoutput3B >test3outputB
495 locale -a | grep '^fr$' >/dev/null
496 if [ $? -eq 0 ] ; then
498 sed 's/fr_FR/fr/' $testdata/intestinput3 >test3input
499 sed 's/fr_FR/fr/' $testdata/intestoutput3 >test3output
500 sed 's/fr_FR/fr/' $testdata/intestoutput3A >test3outputA
501 sed 's/fr_FR/fr/' $testdata/intestoutput3B >test3outputB
508 if [ "$locale" != "" ] ; then
509 echo $title3 "(using '$locale' locale)"
510 for opt in "" "-s" $jitopt; do
511 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $infile testtry
513 if $cf $outfile testtry >teststdout || \
514 $cf $outfile2 testtry >teststdout || \
515 $cf $outfile3 testtry >teststdout
517 if [ "$opt" = "-s" ] ; then echo " OK with study"
518 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
522 echo "** Locale test did not run successfully. The output did not match"
523 echo " $outfile, $outfile2 or $outfile3."
524 echo " This may mean that there is a problem with the locale settings rather"
525 echo " than a bug in PCRE."
532 echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or"
533 echo "'french' locales exist, or the \"locale\" command is not available"
534 echo "to check for them."
539 # Additional tests for UTF support
541 if [ $do4 = yes ] ; then
542 echo ${title4A}-${bits}${title4B}
543 if [ $utf -eq 0 ] ; then
544 echo " Skipped because UTF-$bits support is not available"
546 for opt in "" "-s" $jitopt; do
547 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput4 testtry
549 $cf $testdata/testoutput4 testtry
550 if [ $? != 0 ] ; then exit 1; fi
553 if [ "$opt" = "-s" ] ; then echo " OK with study"
554 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
561 if [ $do5 = yes ] ; then
562 echo ${title5}-${bits} support
563 if [ $utf -eq 0 ] ; then
564 echo " Skipped because UTF-$bits support is not available"
566 for opt in "" "-s" $jitopt; do
567 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput5 testtry
569 $cf $testdata/testoutput5 testtry
570 if [ $? != 0 ] ; then exit 1; fi
573 if [ "$opt" = "-s" ] ; then echo " OK with study"
574 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
581 if [ $do6 = yes ] ; then
583 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
584 echo " Skipped because Unicode property support is not available"
586 for opt in "" "-s" $jitopt; do
587 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput6 testtry
589 $cf $testdata/testoutput6 testtry
590 if [ $? != 0 ] ; then exit 1; fi
593 if [ "$opt" = "-s" ] ; then echo " OK with study"
594 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
601 # Test non-Perl-compatible Unicode property support
603 if [ $do7 = yes ] ; then
605 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
606 echo " Skipped because Unicode property support is not available"
608 for opt in "" "-s" $jitopt; do
609 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput7 testtry
611 $cf $testdata/testoutput7 testtry
612 if [ $? != 0 ] ; then exit 1; fi
615 if [ "$opt" = "-s" ] ; then echo " OK with study"
616 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
623 # Tests for DFA matching support
625 if [ $do8 = yes ] ; then
627 for opt in "" "-s"; do
628 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
630 $cf $testdata/testoutput8 testtry
631 if [ $? != 0 ] ; then exit 1; fi
634 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
638 if [ $do9 = yes ] ; then
639 echo ${title9}-${bits}
640 if [ $utf -eq 0 ] ; then
641 echo " Skipped because UTF-$bits support is not available"
643 for opt in "" "-s"; do
644 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
646 $cf $testdata/testoutput9 testtry
647 if [ $? != 0 ] ; then exit 1; fi
650 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
655 if [ $do10 = yes ] ; then
657 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
658 echo " Skipped because Unicode property support is not available"
660 for opt in "" "-s"; do
661 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
663 $cf $testdata/testoutput10 testtry
664 if [ $? != 0 ] ; then exit 1; fi
667 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
672 # Test of internal offsets and code sizes. This test is run only when there
673 # is Unicode property support and the link size is 2. The actual tests are
674 # mostly the same as in some of the above, but in this test we inspect some
675 # offsets and sizes that require a known link size. This is a doublecheck for
676 # the maintainer, just in case something changes unexpectely. The output from
677 # this test is not the same in 8-bit and 16-bit modes.
679 if [ $do11 = yes ] ; then
681 if [ $link_size -ne 2 ] ; then
682 echo " Skipped because link size is not 2"
683 elif [ $ucp -eq 0 ] ; then
684 echo " Skipped because Unicode property support is not available"
686 for opt in "" "-s"; do
687 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
689 $cf $testdata/testoutput11-$bits testtry
690 if [ $? != 0 ] ; then exit 1; fi
693 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
698 # Test JIT-specific features when JIT is available
700 if [ $do12 = yes ] ; then
702 if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
703 echo " Skipped because JIT is not available or not usable"
705 $sim $valgrind $vjs ./pcretest -q $bmode $testdata/testinput12 testtry
707 $cf $testdata/testoutput12 testtry
708 if [ $? != 0 ] ; then exit 1; fi
715 # Test JIT-specific features when JIT is not available
717 if [ $do13 = yes ] ; then
719 if [ $jit -ne 0 ] ; then
720 echo " Skipped because JIT is available"
722 $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
724 $cf $testdata/testoutput13 testtry
725 if [ $? != 0 ] ; then exit 1; fi
732 # Tests for 8-bit-specific features
734 if [ "$do14" = yes ] ; then
736 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
737 echo " Skipped when running 16/32-bit tests"
739 cp -f $testdata/saved16 testsaved16
740 cp -f $testdata/saved32 testsaved32
741 for opt in "" "-s" $jitopt; do
742 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput14 testtry
744 $cf $testdata/testoutput14 testtry
745 if [ $? != 0 ] ; then exit 1; fi
748 if [ "$opt" = "-s" ] ; then echo " OK with study"
749 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
756 # Tests for 8-bit-specific features (needs UTF-8 support)
758 if [ "$do15" = yes ] ; then
760 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
761 echo " Skipped when running 16/32-bit tests"
762 elif [ $utf -eq 0 ] ; then
763 echo " Skipped because UTF-$bits support is not available"
765 for opt in "" "-s" $jitopt; do
766 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput15 testtry
768 $cf $testdata/testoutput15 testtry
769 if [ $? != 0 ] ; then exit 1; fi
772 if [ "$opt" = "-s" ] ; then echo " OK with study"
773 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
780 # Tests for 8-bit-specific features (Unicode property support)
782 if [ $do16 = yes ] ; then
784 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
785 echo " Skipped when running 16/32-bit tests"
786 elif [ $ucp -eq 0 ] ; then
787 echo " Skipped because Unicode property support is not available"
789 for opt in "" "-s" $jitopt; do
790 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput16 testtry
792 $cf $testdata/testoutput16 testtry
793 if [ $? != 0 ] ; then exit 1; fi
796 if [ "$opt" = "-s" ] ; then echo " OK with study"
797 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
804 # Tests for 16/32-bit-specific features
806 if [ $do17 = yes ] ; then
808 if [ "$bits" = "8" ] ; then
809 echo " Skipped when running 8-bit tests"
811 for opt in "" "-s" $jitopt; do
812 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput17 testtry
814 $cf $testdata/testoutput17 testtry
815 if [ $? != 0 ] ; then exit 1; fi
818 if [ "$opt" = "-s" ] ; then echo " OK with study"
819 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
826 # Tests for 16/32-bit-specific features (UTF-16/32 support)
828 if [ $do18 = yes ] ; then
830 if [ "$bits" = "8" ] ; then
831 echo " Skipped when running 8-bit tests"
832 elif [ $utf -eq 0 ] ; then
833 echo " Skipped because UTF-$bits support is not available"
835 for opt in "" "-s" $jitopt; do
836 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput18 testtry
838 $cf $testdata/testoutput18-$bits testtry
839 if [ $? != 0 ] ; then exit 1; fi
842 if [ "$opt" = "-s" ] ; then echo " OK with study"
843 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
850 # Tests for 16/32-bit-specific features (Unicode property support)
852 if [ $do19 = yes ] ; then
854 if [ "$bits" = "8" ] ; then
855 echo " Skipped when running 8-bit tests"
856 elif [ $ucp -eq 0 ] ; then
857 echo " Skipped because Unicode property support is not available"
859 for opt in "" "-s" $jitopt; do
860 $sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput19 testtry
862 $cf $testdata/testoutput19 testtry
863 if [ $? != 0 ] ; then exit 1; fi
866 if [ "$opt" = "-s" ] ; then echo " OK with study"
867 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
874 # Tests for 16/32-bit-specific features in DFA non-UTF-16/32 mode
876 if [ $do20 = yes ] ; then
878 if [ "$bits" = "8" ] ; then
879 echo " Skipped when running 8-bit tests"
881 for opt in "" "-s"; do
882 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput20 testtry
884 $cf $testdata/testoutput20 testtry
885 if [ $? != 0 ] ; then exit 1; fi
888 if [ "$opt" = "-s" ] ; then echo " OK with study"
895 # Tests for reloads with 16/32-bit library
897 if [ $do21 = yes ] ; then
899 if [ "$bits" = "8" ] ; then
900 echo " Skipped when running 8-bit tests"
901 elif [ $link_size -ne 2 ] ; then
902 echo " Skipped because link size is not 2"
904 cp -f $testdata/saved8 testsaved8
905 cp -f $testdata/saved16LE-1 testsaved16LE-1
906 cp -f $testdata/saved16BE-1 testsaved16BE-1
907 cp -f $testdata/saved32LE-1 testsaved32LE-1
908 cp -f $testdata/saved32BE-1 testsaved32BE-1
909 $sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry
911 $cf $testdata/testoutput21-$bits testtry
912 if [ $? != 0 ] ; then exit 1; fi
919 # Tests for reloads with 16/32-bit library (UTF-16 support)
921 if [ $do22 = yes ] ; then
923 if [ "$bits" = "8" ] ; then
924 echo " Skipped when running 8-bit tests"
925 elif [ $utf -eq 0 ] ; then
926 echo " Skipped because UTF-$bits support is not available"
927 elif [ $link_size -ne 2 ] ; then
928 echo " Skipped because link size is not 2"
930 cp -f $testdata/saved16LE-2 testsaved16LE-2
931 cp -f $testdata/saved16BE-2 testsaved16BE-2
932 cp -f $testdata/saved32LE-2 testsaved32LE-2
933 cp -f $testdata/saved32BE-2 testsaved32BE-2
934 $sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry
936 $cf $testdata/testoutput22-$bits testtry
937 if [ $? != 0 ] ; then exit 1; fi
944 if [ $do23 = yes ] ; then
946 if [ "$bits" = "8" -o "$bits" = "32" ] ; then
947 echo " Skipped when running 8/32-bit tests"
949 $sim $valgrind ./pcretest -q $bmode $testdata/testinput23 testtry
951 $cf $testdata/testoutput23 testtry
952 if [ $? != 0 ] ; then exit 1; fi
959 if [ $do24 = yes ] ; then
961 if [ "$bits" = "8" -o "$bits" = "32" ] ; then
962 echo " Skipped when running 8/32-bit tests"
963 elif [ $utf -eq 0 ] ; then
964 echo " Skipped because UTF-$bits support is not available"
966 $sim $valgrind ./pcretest -q $bmode $testdata/testinput24 testtry
968 $cf $testdata/testoutput24 testtry
969 if [ $? != 0 ] ; then exit 1; fi
976 if [ $do25 = yes ] ; then
978 if [ "$bits" = "8" -o "$bits" = "16" ] ; then
979 echo " Skipped when running 8/16-bit tests"
981 $sim $valgrind ./pcretest -q $bmode $testdata/testinput25 testtry
983 $cf $testdata/testoutput25 testtry
984 if [ $? != 0 ] ; then exit 1; fi
991 if [ $do26 = yes ] ; then
993 if [ "$bits" = "8" -o "$bits" = "16" ] ; then
994 echo " Skipped when running 8/16-bit tests"
995 elif [ $utf -eq 0 ] ; then
996 echo " Skipped because UTF-$bits support is not available"
998 $sim $valgrind ./pcretest -q $bmode $testdata/testinput26 testtry
1000 $cf $testdata/testoutput26 testtry
1001 if [ $? != 0 ] ; then exit 1; fi
1008 # End of loop for 8/16/32-bit tests
1011 # Clean up local working files
1012 rm -f test3input test3output test3outputA testNinput testsaved* teststderr teststdout testtry