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 ------
182 # This is in case the caller has set aliases (as I do - PH)
185 # Process options and select which tests to run; for those that are explicitly
186 # requested, check that the necessary optional facilities are available.
215 while [ $# -gt 0 ] ; do
248 valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
249 valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
251 if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
252 skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
254 echo "Unknown option or test selector '$1'"; exit 1
258 if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
259 tf=`expr "$1" : '\([0-9]*\)'`
260 tt=`expr "$1" : '.*-\([0-9]*\)'`
261 if [ "$tt" = "" ] ; then tt=$maxtest; fi
262 if expr \( "$tf" "<" 1 \) \| \( "$tt" ">" "$maxtest" \) >/dev/null; then
263 echo "Invalid test range '$1'"; exit 1
265 while expr "$tf" "<=" "$tt" >/dev/null; do
270 echo "Invalid test range '$1'"; exit 1
273 *) echo "Unknown option or test selector '$1'"; exit 1;;
278 # Find which optional facilities are available.
280 $sim ./pcretest -C linksize >/dev/null
282 if [ $link_size -lt 2 ] ; then
283 echo "Failed to find internal link size"
286 if [ $link_size -gt 4 ] ; then
287 echo "Failed to find internal link size"
291 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
294 $sim ./pcretest -C pcre8 >/dev/null
296 $sim ./pcretest -C pcre16 >/dev/null
298 $sim ./pcretest -C pcre32 >/dev/null
301 # Initialize all bitsizes skipped
307 # If no bitsize arguments, select all that are available
309 if [ "$arg8$arg16$arg32" = "" ] ; then
310 if [ $support8 -ne 0 ] ; then
313 if [ $support16 -ne 0 ] ; then
316 if [ $support32 -ne 0 ] ; then
320 # Select requested bit sizes
323 if [ "$arg8" = yes ] ; then
324 if [ $support8 -eq 0 ] ; then
325 echo "Cannot run 8-bit library tests: 8-bit library not compiled"
330 if [ "$arg16" = yes ] ; then
331 if [ $support16 -eq 0 ] ; then
332 echo "Cannot run 16-bit library tests: 16-bit library not compiled"
337 if [ "$arg32" = yes ] ; then
338 if [ $support32 -eq 0 ] ; then
339 echo "Cannot run 32-bit library tests: 32-bit library not compiled"
346 # UTF support always applies to all bit sizes if both are supported; we can't
347 # have UTF-8 support without UTF-16 support (for example).
349 $sim ./pcretest -C utf >/dev/null
352 $sim ./pcretest -C ucp >/dev/null
356 $sim ./pcretest -C jit >/dev/null
358 if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
362 # If no specific tests were requested, select all. Those that are not
363 # relevant will be automatically skipped.
365 if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
366 $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
367 $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
368 $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
369 $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \
370 $do21 = no -a $do22 = no -a $do23 = no -a $do24 = no -a \
371 $do25 = no -a $do26 = no ] ; then
400 # Handle any explicit skips at this stage, so that an argument list may consist
401 # only of explicit skips.
403 for i in $skip; do eval do$i=no; done
405 # Show which release and which test data
408 echo PCRE C library tests using test data from $testdata
409 $sim ./pcretest /dev/null
411 for bmode in "$test8" "$test16" "$test32"; do
414 -16) if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
415 bits=16; echo "---- Testing 16-bit library ----"; echo "";;
416 -32) if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
417 bits=32; echo "---- Testing 32-bit library ----"; echo "";;
418 *) bits=8; echo "---- Testing 8-bit library ----"; echo "";;
421 # Primary test, compatible with JIT and all versions of Perl >= 5.8
423 if [ $do1 = yes ] ; then
425 for opt in "" "-s" $jitopt; do
426 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
428 $cf $testdata/testoutput1 testtry
429 if [ $? != 0 ] ; then exit 1; fi
432 if [ "$opt" = "-s" ] ; then echo " OK with study"
433 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
439 # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
441 if [ $do2 = yes ] ; then
442 echo $title2 "(not UTF-$bits)"
443 for opt in "" "-s" $jitopt; do
444 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
446 $cf $testdata/testoutput2 testtry
447 if [ $? != 0 ] ; then exit 1; fi
450 echo "** Test 2 requires a lot of stack. If it has crashed with a"
451 echo "** segmentation fault, it may be that you do not have enough"
452 echo "** stack available by default. Please see the 'pcrestack' man"
453 echo "** page for a discussion of PCRE's stack usage."
457 if [ "$opt" = "-s" ] ; then echo " OK with study"
458 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
464 # Locale-specific tests, provided that either the "fr_FR" or the "french"
465 # locale is available. The former is the Unix-like standard; the latter is
466 # for Windows. Another possibility is "fr". Unfortunately, different versions
467 # of the French locale give different outputs for some items. This test passes
468 # if the output matches any one of the alternative output files.
470 if [ $do3 = yes ] ; then
471 locale -a | grep '^fr_FR$' >/dev/null
472 if [ $? -eq 0 ] ; then
474 infile=$testdata/testinput3
475 outfile=$testdata/testoutput3
476 outfile2=$testdata/testoutput3A
477 outfile3=$testdata/testoutput3B
481 outfile2=test3outputA
482 outfile3=test3outputB
483 locale -a | grep '^french$' >/dev/null
484 if [ $? -eq 0 ] ; then
486 sed 's/fr_FR/french/' $testdata/testinput3 >test3input
487 sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
488 sed 's/fr_FR/french/' $testdata/testoutput3A >test3outputA
489 sed 's/fr_FR/french/' $testdata/testoutput3B >test3outputB
491 locale -a | grep '^fr$' >/dev/null
492 if [ $? -eq 0 ] ; then
494 sed 's/fr_FR/fr/' $testdata/intestinput3 >test3input
495 sed 's/fr_FR/fr/' $testdata/intestoutput3 >test3output
496 sed 's/fr_FR/fr/' $testdata/intestoutput3A >test3outputA
497 sed 's/fr_FR/fr/' $testdata/intestoutput3B >test3outputB
504 if [ "$locale" != "" ] ; then
505 echo $title3 "(using '$locale' locale)"
506 for opt in "" "-s" $jitopt; do
507 $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
509 if $cf $outfile testtry >teststdout || \
510 $cf $outfile2 testtry >teststdout || \
511 $cf $outfile3 testtry >teststdout
513 if [ "$opt" = "-s" ] ; then echo " OK with study"
514 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
518 echo "** Locale test did not run successfully. The output did not match"
519 echo " $outfile, $outfile2 or $outfile3."
520 echo " This may mean that there is a problem with the locale settings rather"
521 echo " than a bug in PCRE."
528 echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or"
529 echo "'french' locales exist, or the \"locale\" command is not available"
530 echo "to check for them."
535 # Additional tests for UTF support
537 if [ $do4 = yes ] ; then
538 echo ${title4A}-${bits}${title4B}
539 if [ $utf -eq 0 ] ; then
540 echo " Skipped because UTF-$bits support is not available"
542 for opt in "" "-s" $jitopt; do
543 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
545 $cf $testdata/testoutput4 testtry
546 if [ $? != 0 ] ; then exit 1; fi
549 if [ "$opt" = "-s" ] ; then echo " OK with study"
550 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
557 if [ $do5 = yes ] ; then
558 echo ${title5}-${bits} support
559 if [ $utf -eq 0 ] ; then
560 echo " Skipped because UTF-$bits support is not available"
562 for opt in "" "-s" $jitopt; do
563 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
565 $cf $testdata/testoutput5 testtry
566 if [ $? != 0 ] ; then exit 1; fi
569 if [ "$opt" = "-s" ] ; then echo " OK with study"
570 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
577 if [ $do6 = yes ] ; then
579 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
580 echo " Skipped because Unicode property support is not available"
582 for opt in "" "-s" $jitopt; do
583 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
585 $cf $testdata/testoutput6 testtry
586 if [ $? != 0 ] ; then exit 1; fi
589 if [ "$opt" = "-s" ] ; then echo " OK with study"
590 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
597 # Test non-Perl-compatible Unicode property support
599 if [ $do7 = yes ] ; then
601 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
602 echo " Skipped because Unicode property support is not available"
604 for opt in "" "-s" $jitopt; do
605 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
607 $cf $testdata/testoutput7 testtry
608 if [ $? != 0 ] ; then exit 1; fi
611 if [ "$opt" = "-s" ] ; then echo " OK with study"
612 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
619 # Tests for DFA matching support
621 if [ $do8 = yes ] ; then
623 for opt in "" "-s"; do
624 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
626 $cf $testdata/testoutput8 testtry
627 if [ $? != 0 ] ; then exit 1; fi
630 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
634 if [ $do9 = yes ] ; then
635 echo ${title9}-${bits}
636 if [ $utf -eq 0 ] ; then
637 echo " Skipped because UTF-$bits support is not available"
639 for opt in "" "-s"; do
640 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
642 $cf $testdata/testoutput9 testtry
643 if [ $? != 0 ] ; then exit 1; fi
646 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
651 if [ $do10 = yes ] ; then
653 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
654 echo " Skipped because Unicode property support is not available"
656 for opt in "" "-s"; do
657 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
659 $cf $testdata/testoutput10 testtry
660 if [ $? != 0 ] ; then exit 1; fi
663 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
668 # Test of internal offsets and code sizes. This test is run only when there
669 # is Unicode property support and the link size is 2. The actual tests are
670 # mostly the same as in some of the above, but in this test we inspect some
671 # offsets and sizes that require a known link size. This is a doublecheck for
672 # the maintainer, just in case something changes unexpectely. The output from
673 # this test is not the same in 8-bit and 16-bit modes.
675 if [ $do11 = yes ] ; then
677 if [ $link_size -ne 2 ] ; then
678 echo " Skipped because link size is not 2"
679 elif [ $ucp -eq 0 ] ; then
680 echo " Skipped because Unicode property support is not available"
682 for opt in "" "-s"; do
683 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
685 $cf $testdata/testoutput11-$bits testtry
686 if [ $? != 0 ] ; then exit 1; fi
689 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
694 # Test JIT-specific features when JIT is available
696 if [ $do12 = yes ] ; then
698 if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
699 echo " Skipped because JIT is not available or not usable"
701 $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
703 $cf $testdata/testoutput12 testtry
704 if [ $? != 0 ] ; then exit 1; fi
711 # Test JIT-specific features when JIT is not available
713 if [ $do13 = yes ] ; then
715 if [ $jit -ne 0 ] ; then
716 echo " Skipped because JIT is available"
718 $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
720 $cf $testdata/testoutput13 testtry
721 if [ $? != 0 ] ; then exit 1; fi
728 # Tests for 8-bit-specific features
730 if [ "$do14" = yes ] ; then
732 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
733 echo " Skipped when running 16/32-bit tests"
735 cp -f $testdata/saved16 testsaved16
736 cp -f $testdata/saved32 testsaved32
737 for opt in "" "-s" $jitopt; do
738 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
740 $cf $testdata/testoutput14 testtry
741 if [ $? != 0 ] ; then exit 1; fi
744 if [ "$opt" = "-s" ] ; then echo " OK with study"
745 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
752 # Tests for 8-bit-specific features (needs UTF-8 support)
754 if [ "$do15" = yes ] ; then
756 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
757 echo " Skipped when running 16/32-bit tests"
758 elif [ $utf -eq 0 ] ; then
759 echo " Skipped because UTF-$bits support is not available"
761 for opt in "" "-s" $jitopt; do
762 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
764 $cf $testdata/testoutput15 testtry
765 if [ $? != 0 ] ; then exit 1; fi
768 if [ "$opt" = "-s" ] ; then echo " OK with study"
769 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
776 # Tests for 8-bit-specific features (Unicode property support)
778 if [ $do16 = yes ] ; then
780 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
781 echo " Skipped when running 16/32-bit tests"
782 elif [ $ucp -eq 0 ] ; then
783 echo " Skipped because Unicode property support is not available"
785 for opt in "" "-s" $jitopt; do
786 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
788 $cf $testdata/testoutput16 testtry
789 if [ $? != 0 ] ; then exit 1; fi
792 if [ "$opt" = "-s" ] ; then echo " OK with study"
793 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
800 # Tests for 16/32-bit-specific features
802 if [ $do17 = yes ] ; then
804 if [ "$bits" = "8" ] ; then
805 echo " Skipped when running 8-bit tests"
807 for opt in "" "-s" $jitopt; do
808 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
810 $cf $testdata/testoutput17 testtry
811 if [ $? != 0 ] ; then exit 1; fi
814 if [ "$opt" = "-s" ] ; then echo " OK with study"
815 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
822 # Tests for 16/32-bit-specific features (UTF-16/32 support)
824 if [ $do18 = yes ] ; then
826 if [ "$bits" = "8" ] ; then
827 echo " Skipped when running 8-bit tests"
828 elif [ $utf -eq 0 ] ; then
829 echo " Skipped because UTF-$bits support is not available"
831 for opt in "" "-s" $jitopt; do
832 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
834 $cf $testdata/testoutput18-$bits testtry
835 if [ $? != 0 ] ; then exit 1; fi
838 if [ "$opt" = "-s" ] ; then echo " OK with study"
839 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
846 # Tests for 16/32-bit-specific features (Unicode property support)
848 if [ $do19 = yes ] ; then
850 if [ "$bits" = "8" ] ; then
851 echo " Skipped when running 8-bit tests"
852 elif [ $ucp -eq 0 ] ; then
853 echo " Skipped because Unicode property support is not available"
855 for opt in "" "-s" $jitopt; do
856 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
858 $cf $testdata/testoutput19 testtry
859 if [ $? != 0 ] ; then exit 1; fi
862 if [ "$opt" = "-s" ] ; then echo " OK with study"
863 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
870 # Tests for 16/32-bit-specific features in DFA non-UTF-16/32 mode
872 if [ $do20 = yes ] ; then
874 if [ "$bits" = "8" ] ; then
875 echo " Skipped when running 8-bit tests"
877 for opt in "" "-s"; do
878 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput20 testtry
880 $cf $testdata/testoutput20 testtry
881 if [ $? != 0 ] ; then exit 1; fi
884 if [ "$opt" = "-s" ] ; then echo " OK with study"
891 # Tests for reloads with 16/32-bit library
893 if [ $do21 = yes ] ; then
895 if [ "$bits" = "8" ] ; then
896 echo " Skipped when running 8-bit tests"
897 elif [ $link_size -ne 2 ] ; then
898 echo " Skipped because link size is not 2"
900 cp -f $testdata/saved8 testsaved8
901 cp -f $testdata/saved16LE-1 testsaved16LE-1
902 cp -f $testdata/saved16BE-1 testsaved16BE-1
903 cp -f $testdata/saved32LE-1 testsaved32LE-1
904 cp -f $testdata/saved32BE-1 testsaved32BE-1
905 $sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry
907 $cf $testdata/testoutput21-$bits testtry
908 if [ $? != 0 ] ; then exit 1; fi
915 # Tests for reloads with 16/32-bit library (UTF-16 support)
917 if [ $do22 = yes ] ; then
919 if [ "$bits" = "8" ] ; then
920 echo " Skipped when running 8-bit tests"
921 elif [ $utf -eq 0 ] ; then
922 echo " Skipped because UTF-$bits support is not available"
923 elif [ $link_size -ne 2 ] ; then
924 echo " Skipped because link size is not 2"
926 cp -f $testdata/saved16LE-2 testsaved16LE-2
927 cp -f $testdata/saved16BE-2 testsaved16BE-2
928 cp -f $testdata/saved32LE-2 testsaved32LE-2
929 cp -f $testdata/saved32BE-2 testsaved32BE-2
930 $sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry
932 $cf $testdata/testoutput22-$bits testtry
933 if [ $? != 0 ] ; then exit 1; fi
940 if [ $do23 = yes ] ; then
942 if [ "$bits" = "8" -o "$bits" = "32" ] ; then
943 echo " Skipped when running 8/32-bit tests"
945 $sim $valgrind ./pcretest -q $bmode $testdata/testinput23 testtry
947 $cf $testdata/testoutput23 testtry
948 if [ $? != 0 ] ; then exit 1; fi
955 if [ $do24 = yes ] ; then
957 if [ "$bits" = "8" -o "$bits" = "32" ] ; then
958 echo " Skipped when running 8/32-bit tests"
959 elif [ $utf -eq 0 ] ; then
960 echo " Skipped because UTF-$bits support is not available"
962 $sim $valgrind ./pcretest -q $bmode $testdata/testinput24 testtry
964 $cf $testdata/testoutput24 testtry
965 if [ $? != 0 ] ; then exit 1; fi
972 if [ $do25 = yes ] ; then
974 if [ "$bits" = "8" -o "$bits" = "16" ] ; then
975 echo " Skipped when running 8/16-bit tests"
977 $sim $valgrind ./pcretest -q $bmode $testdata/testinput25 testtry
979 $cf $testdata/testoutput25 testtry
980 if [ $? != 0 ] ; then exit 1; fi
987 if [ $do26 = yes ] ; then
989 if [ "$bits" = "8" -o "$bits" = "16" ] ; then
990 echo " Skipped when running 8/16-bit tests"
991 elif [ $utf -eq 0 ] ; then
992 echo " Skipped because UTF-$bits support is not available"
994 $sim $valgrind ./pcretest -q $bmode $testdata/testinput26 testtry
996 $cf $testdata/testoutput26 testtry
997 if [ $? != 0 ] ; then exit 1; fi
1004 # End of loop for 8/16/32-bit tests
1007 # Clean up local working files
1008 rm -f test3input test3output test3outputA testNinput testsaved* teststderr teststdout testtry