2014-07-24 12:32:38 -04:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Run the PCRE2 tests using the pcre2test program. The appropriate tests are
|
|
|
|
# selected, depending on which build-time options were used.
|
|
|
|
#
|
|
|
|
# When JIT support is available, all appropriate tests are run with and without
|
2015-04-24 11:23:15 -04:00
|
|
|
# JIT, unless "-nojit" is given on the command line. There are also two tests
|
2014-07-24 12:32:38 -04:00
|
|
|
# for JIT-specific features, one to be run when JIT support is available
|
2015-04-24 11:23:15 -04:00
|
|
|
# (unless "-nojit" is specified), and one when it is not.
|
2014-07-24 12:32:38 -04:00
|
|
|
#
|
|
|
|
# Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
|
|
|
|
# possible to select which to test by giving "-8", "-16" or "-32" on the
|
|
|
|
# command line.
|
|
|
|
#
|
2015-04-24 11:23:15 -04:00
|
|
|
# As well as "-nojit", "-8", "-16", and "-32", arguments for this script are
|
2014-07-24 12:32:38 -04:00
|
|
|
# individual test numbers, ranges of tests such as 3-6 or 3- (meaning 3 to the
|
|
|
|
# end), or a number preceded by ~ to exclude a test. For example, "3-15 ~10"
|
|
|
|
# runs tests 3 to 15, excluding test 10, and just "~10" runs all the tests
|
|
|
|
# except test 10. Whatever order the arguments are in, the tests are always run
|
|
|
|
# in numerical order.
|
|
|
|
#
|
2014-10-31 08:34:34 -04:00
|
|
|
# Inappropriate tests are automatically skipped (with a comment to say so). For
|
|
|
|
# example, if JIT support is not compiled, test 16 is skipped, whereas if JIT
|
|
|
|
# support is compiled, test 15 is skipped.
|
2014-07-24 12:32:38 -04:00
|
|
|
#
|
2015-06-18 12:39:25 -04:00
|
|
|
# Other arguments can be one of the words "-valgrind", "-valgrind-log", or
|
|
|
|
# "-sim" followed by an argument to run cross-compiled executables under a
|
2015-04-24 11:23:15 -04:00
|
|
|
# simulator, for example:
|
2014-07-24 12:32:38 -04:00
|
|
|
#
|
2015-04-24 11:23:15 -04:00
|
|
|
# RunTest 3 -sim "qemu-arm -s 8388608"
|
|
|
|
#
|
|
|
|
# For backwards compatibility, -nojit, -valgrind, -valgrind-log, and -sim may
|
|
|
|
# be given without the leading "-" character.
|
2014-07-24 12:32:38 -04:00
|
|
|
#
|
2015-07-24 09:30:50 -04:00
|
|
|
# When PCRE2 is compiled by clang with -fsanitize arguments, some tests need
|
|
|
|
# very much more stack than normal. In environments where the stack can be
|
|
|
|
# set at runtime, -bigstack sets a gigantic stack.
|
|
|
|
#
|
2014-07-24 12:32:38 -04:00
|
|
|
# There are two special cases where only one argument is allowed:
|
|
|
|
#
|
|
|
|
# If the first and only argument is "ebcdic", the script runs the special
|
|
|
|
# EBCDIC test that can be useful for checking certain EBCDIC features, even
|
2015-04-24 11:23:15 -04:00
|
|
|
# when run in an ASCII environment. PCRE2 must be built with EBCDIC support for
|
|
|
|
# this test to be run.
|
2014-07-24 12:32:38 -04:00
|
|
|
#
|
|
|
|
# If the script is obeyed as "RunTest list", a list of available tests is
|
|
|
|
# output, but none of them are run.
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# Define test titles in variables so that they can be output as a list. Some
|
|
|
|
# of them are modified (e.g. with -8 or -16) when used in the actual tests.
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
title0="Test 0: Unchecked pcre2test argument tests (to improve coverage)"
|
2014-08-03 13:50:08 -04:00
|
|
|
title1="Test 1: Main non-UTF, non-UCP functionality (compatible with Perl >= 5.10)"
|
2016-06-22 15:23:33 -04:00
|
|
|
title2="Test 2: API, errors, internals and non-Perl stuff"
|
2014-07-24 14:01:11 -04:00
|
|
|
title3="Test 3: Locale-specific features"
|
2014-07-25 12:35:51 -04:00
|
|
|
title4A="Test 4: UTF"
|
2014-08-03 13:50:08 -04:00
|
|
|
title4B=" and Unicode property support (compatible with Perl >= 5.10)"
|
|
|
|
title5A="Test 5: API, internals, and non-Perl stuff for UTF"
|
|
|
|
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"
|
2014-08-05 12:51:32 -04:00
|
|
|
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"
|
2015-08-18 06:34:05 -04:00
|
|
|
title14="Test 14: DFA specials for UTF and UCP support"
|
|
|
|
title15="Test 15: Non-JIT limits and other non-JIT tests"
|
|
|
|
title16="Test 16: JIT-specific features when JIT is not available"
|
|
|
|
title17="Test 17: JIT-specific features when JIT is available"
|
|
|
|
title18="Test 18: Tests of the POSIX interface, excluding UTF/UCP"
|
|
|
|
title19="Test 19: Tests of the POSIX interface with UTF/UCP"
|
2016-02-26 13:26:17 -05:00
|
|
|
title20="Test 20: Serialization and code copy tests"
|
2015-10-17 09:50:56 -04:00
|
|
|
title21="Test 21: \C tests without UTF (supported for DFA matching)"
|
|
|
|
title22="Test 22: \C tests with UTF (not supported for DFA matching)"
|
|
|
|
title23="Test 23: \C disabled test"
|
2017-05-06 12:19:39 -04:00
|
|
|
title24="Test 24: Non-UTF pattern conversion tests"
|
|
|
|
title25="Test 25: UTF pattern conversion tests"
|
|
|
|
maxtest=25
|
2014-07-24 12:32:38 -04:00
|
|
|
|
|
|
|
if [ $# -eq 1 -a "$1" = "list" ]; then
|
2014-10-31 08:34:34 -04:00
|
|
|
echo $title0
|
2014-07-24 12:32:38 -04:00
|
|
|
echo $title1
|
2014-08-03 13:50:08 -04:00
|
|
|
echo $title2 "(not UTF or UCP)"
|
2014-07-24 14:01:11 -04:00
|
|
|
echo $title3
|
2014-07-25 12:35:51 -04:00
|
|
|
echo $title4A $title4B
|
2014-08-03 13:50:08 -04:00
|
|
|
echo $title5A $title5B
|
|
|
|
echo $title6
|
|
|
|
echo $title7A $title7B
|
2014-08-05 12:51:32 -04:00
|
|
|
echo $title8
|
|
|
|
echo $title9
|
|
|
|
echo $title10
|
|
|
|
echo $title11
|
|
|
|
echo $title12
|
|
|
|
echo $title13
|
2014-08-08 14:18:18 -04:00
|
|
|
echo $title14
|
|
|
|
echo $title15
|
|
|
|
echo $title16
|
|
|
|
echo $title17
|
2014-10-06 13:28:42 -04:00
|
|
|
echo $title18
|
2015-01-23 11:51:47 -05:00
|
|
|
echo $title19
|
2015-08-18 06:34:05 -04:00
|
|
|
echo $title20
|
2015-10-17 09:50:56 -04:00
|
|
|
echo $title21
|
|
|
|
echo $title22
|
|
|
|
echo $title23
|
2017-05-06 12:19:39 -04:00
|
|
|
echo $title24
|
|
|
|
echo $title25
|
2014-07-24 12:32:38 -04:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Set up a suitable "diff" command for comparison. Some systems
|
|
|
|
# have a diff that lacks a -u option. Try to deal with this.
|
|
|
|
|
|
|
|
cf="diff"
|
|
|
|
diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
|
|
|
|
|
|
|
|
# Find the test data
|
|
|
|
|
|
|
|
if [ -n "$srcdir" -a -d "$srcdir" ] ; then
|
|
|
|
testdata="$srcdir/testdata"
|
|
|
|
elif [ -d "./testdata" ] ; then
|
|
|
|
testdata=./testdata
|
|
|
|
elif [ -d "../testdata" ] ; then
|
|
|
|
testdata=../testdata
|
|
|
|
else
|
|
|
|
echo "Cannot find the testdata directory"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2014-10-12 12:55:21 -04:00
|
|
|
# ------ Function to check results of a test -------
|
|
|
|
|
|
|
|
# This function is called with three parameters:
|
|
|
|
#
|
|
|
|
# $1 the value of $? after a call to pcre2test
|
|
|
|
# $2 the suffix of the output file to compare with
|
|
|
|
# $3 the $opt value (empty, -jit, or -dfa)
|
2014-10-16 12:22:44 -04:00
|
|
|
#
|
|
|
|
# Note: must define using name(), not "function name", for Solaris.
|
2014-10-12 12:55:21 -04:00
|
|
|
|
2014-10-16 12:22:44 -04:00
|
|
|
checkresult()
|
2014-10-12 12:55:21 -04:00
|
|
|
{
|
2014-10-20 13:28:49 -04:00
|
|
|
if [ $1 -ne 0 ] ; then
|
2014-10-12 12:55:21 -04:00
|
|
|
echo "** pcre2test failed - check testtry"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
case "$3" in
|
|
|
|
-jit) with=" with JIT";;
|
|
|
|
-dfa) with=" with DFA";;
|
|
|
|
*) with="";;
|
|
|
|
esac
|
|
|
|
$cf $testdata/testoutput$2 testtry
|
|
|
|
if [ $? != 0 ] ; then
|
|
|
|
echo ""
|
|
|
|
echo "** Test $2 failed$with"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo " OK$with"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# ------ Function to run and check a special pcre2test arguments test -------
|
|
|
|
|
|
|
|
checkspecial()
|
|
|
|
{
|
2015-09-11 12:56:47 -04:00
|
|
|
$valgrind $vjs ./pcre2test $1 >>testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
echo "** pcre2test $1 failed - check testtry"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-07-24 12:32:38 -04:00
|
|
|
# ------ Special EBCDIC Test -------
|
|
|
|
|
|
|
|
if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
|
2014-10-31 08:34:34 -04:00
|
|
|
$valgrind ./pcre2test -C ebcdic >/dev/null
|
2014-07-24 12:32:38 -04:00
|
|
|
ebcdic=$?
|
|
|
|
if [ $ebcdic -ne 1 ] ; then
|
|
|
|
echo "Cannot run EBCDIC tests: EBCDIC support not compiled"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
for opt in "" "-dfa"; do
|
|
|
|
./pcre2test -q $opt $testdata/testinputEBC >testtry
|
2014-10-12 12:55:21 -04:00
|
|
|
checkresult $? EBC "$opt"
|
2014-07-24 12:32:38 -04:00
|
|
|
done
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# ------ Normal Tests ------
|
|
|
|
|
|
|
|
# Default values
|
|
|
|
|
|
|
|
arg8=
|
|
|
|
arg16=
|
|
|
|
arg32=
|
|
|
|
nojit=
|
2015-07-24 09:30:50 -04:00
|
|
|
bigstack=
|
2014-07-24 12:32:38 -04:00
|
|
|
sim=
|
|
|
|
skip=
|
|
|
|
valgrind=
|
2015-09-11 12:56:47 -04:00
|
|
|
vjs=
|
2014-07-24 12:32:38 -04:00
|
|
|
|
|
|
|
# This is in case the caller has set aliases (as I do - PH)
|
|
|
|
unset cp ls mv rm
|
|
|
|
|
|
|
|
# Process options and select which tests to run; for those that are explicitly
|
|
|
|
# requested, check that the necessary optional facilities are available.
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
do0=no
|
2014-07-24 12:32:38 -04:00
|
|
|
do1=no
|
|
|
|
do2=no
|
2014-07-24 14:01:11 -04:00
|
|
|
do3=no
|
2014-07-25 12:35:51 -04:00
|
|
|
do4=no
|
2014-08-03 13:50:08 -04:00
|
|
|
do5=no
|
|
|
|
do6=no
|
|
|
|
do7=no
|
2014-08-05 12:51:32 -04:00
|
|
|
do8=no
|
|
|
|
do9=no
|
|
|
|
do10=no
|
|
|
|
do11=no
|
|
|
|
do12=no
|
|
|
|
do13=no
|
2014-08-08 14:18:18 -04:00
|
|
|
do14=no
|
|
|
|
do15=no
|
|
|
|
do16=no
|
|
|
|
do17=no
|
2014-10-06 13:28:42 -04:00
|
|
|
do18=no
|
2015-01-23 11:51:47 -05:00
|
|
|
do19=no
|
2015-08-18 06:34:05 -04:00
|
|
|
do20=no
|
2015-10-17 09:50:56 -04:00
|
|
|
do21=no
|
|
|
|
do22=no
|
|
|
|
do23=no
|
2017-05-06 12:19:39 -04:00
|
|
|
do24=no
|
|
|
|
do25=no
|
2014-07-24 12:32:38 -04:00
|
|
|
|
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
case $1 in
|
2014-10-31 08:34:34 -04:00
|
|
|
0) do0=yes;;
|
2014-07-24 12:32:38 -04:00
|
|
|
1) do1=yes;;
|
|
|
|
2) do2=yes;;
|
2014-07-24 14:01:11 -04:00
|
|
|
3) do3=yes;;
|
2014-07-25 12:35:51 -04:00
|
|
|
4) do4=yes;;
|
2014-08-03 13:50:08 -04:00
|
|
|
5) do5=yes;;
|
|
|
|
6) do6=yes;;
|
|
|
|
7) do7=yes;;
|
2014-08-05 12:51:32 -04:00
|
|
|
8) do8=yes;;
|
|
|
|
9) do9=yes;;
|
|
|
|
10) do10=yes;;
|
|
|
|
11) do11=yes;;
|
|
|
|
12) do12=yes;;
|
|
|
|
13) do13=yes;;
|
2014-08-08 14:18:18 -04:00
|
|
|
14) do14=yes;;
|
|
|
|
15) do15=yes;;
|
|
|
|
16) do16=yes;;
|
|
|
|
17) do17=yes;;
|
2014-10-06 13:28:42 -04:00
|
|
|
18) do18=yes;;
|
2015-01-23 11:51:47 -05:00
|
|
|
19) do19=yes;;
|
2015-08-18 06:34:05 -04:00
|
|
|
20) do20=yes;;
|
2015-10-17 09:50:56 -04:00
|
|
|
21) do21=yes;;
|
|
|
|
22) do22=yes;;
|
|
|
|
23) do23=yes;;
|
2017-05-06 12:19:39 -04:00
|
|
|
24) do24=yes;;
|
|
|
|
25) do25=yes;;
|
2014-07-24 12:32:38 -04:00
|
|
|
-8) arg8=yes;;
|
|
|
|
-16) arg16=yes;;
|
|
|
|
-32) arg32=yes;;
|
2015-08-18 06:34:05 -04:00
|
|
|
bigstack|-bigstack) bigstack=yes;;
|
2015-04-24 11:23:15 -04:00
|
|
|
nojit|-nojit) nojit=yes;;
|
|
|
|
sim|-sim) shift; sim=$1;;
|
2016-01-30 10:19:48 -05:00
|
|
|
valgrind|-valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all-non-file";;
|
|
|
|
valgrind-log|-valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all-non-file --log-file=report.%p ";;
|
2014-07-24 12:32:38 -04:00
|
|
|
~*)
|
|
|
|
if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
|
|
|
|
skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
|
|
|
|
else
|
|
|
|
echo "Unknown option or test selector '$1'"; exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*-*)
|
|
|
|
if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
|
|
|
|
tf=`expr "$1" : '\([0-9]*\)'`
|
|
|
|
tt=`expr "$1" : '.*-\([0-9]*\)'`
|
|
|
|
if [ "$tt" = "" ] ; then tt=$maxtest; fi
|
2014-10-31 08:34:34 -04:00
|
|
|
if expr \( "$tt" ">" "$maxtest" \) >/dev/null; then
|
2014-07-24 12:32:38 -04:00
|
|
|
echo "Invalid test range '$1'"; exit 1
|
|
|
|
fi
|
|
|
|
while expr "$tf" "<=" "$tt" >/dev/null; do
|
|
|
|
eval do${tf}=yes
|
|
|
|
tf=`expr $tf + 1`
|
|
|
|
done
|
|
|
|
else
|
|
|
|
echo "Invalid test range '$1'"; exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*) echo "Unknown option or test selector '$1'"; exit 1;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
# Find which optional facilities are available.
|
|
|
|
|
|
|
|
$sim ./pcre2test -C linksize >/dev/null
|
|
|
|
link_size=$?
|
|
|
|
if [ $link_size -lt 2 ] ; then
|
2014-11-08 11:07:30 -05:00
|
|
|
echo "RunTest: Failed to find internal link size"
|
2014-07-24 12:32:38 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if [ $link_size -gt 4 ] ; then
|
2014-11-08 11:07:30 -05:00
|
|
|
echo "RunTest: Failed to find internal link size"
|
2014-07-24 12:32:38 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-03-10 12:48:48 -05:00
|
|
|
# If it is possible to set the system stack size and -bigstack was given,
|
|
|
|
# set up a large stack.
|
2014-11-21 07:19:37 -05:00
|
|
|
|
|
|
|
$sim ./pcre2test -S 1 /dev/null /dev/null
|
2017-03-10 12:48:48 -05:00
|
|
|
if [ $? -eq 0 -a "$bigstack" != "" ] ; then
|
2017-05-10 14:21:03 -04:00
|
|
|
setstack="-S 64"
|
2014-11-21 07:19:37 -05:00
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
setstack=""
|
2014-11-21 11:45:06 -05:00
|
|
|
fi
|
2014-11-21 07:19:37 -05:00
|
|
|
|
2014-07-24 12:32:38 -04:00
|
|
|
# All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
|
|
|
|
# one need be.
|
|
|
|
|
2014-10-17 11:52:57 -04:00
|
|
|
$sim ./pcre2test -C pcre2-8 >/dev/null
|
2014-07-24 12:32:38 -04:00
|
|
|
support8=$?
|
2014-10-17 11:52:57 -04:00
|
|
|
$sim ./pcre2test -C pcre2-16 >/dev/null
|
2014-07-24 12:32:38 -04:00
|
|
|
support16=$?
|
2014-10-17 11:52:57 -04:00
|
|
|
$sim ./pcre2test -C pcre2-32 >/dev/null
|
2014-07-24 12:32:38 -04:00
|
|
|
support32=$?
|
|
|
|
|
2015-10-17 09:50:56 -04:00
|
|
|
# \C may be disabled
|
|
|
|
|
|
|
|
$sim ./pcre2test -C backslash-C >/dev/null
|
|
|
|
supportBSC=$?
|
|
|
|
|
2014-07-24 12:32:38 -04:00
|
|
|
# Initialize all bitsizes skipped
|
|
|
|
|
|
|
|
test8=skip
|
|
|
|
test16=skip
|
|
|
|
test32=skip
|
|
|
|
|
|
|
|
# If no bitsize arguments, select all that are available
|
|
|
|
|
|
|
|
if [ "$arg8$arg16$arg32" = "" ] ; then
|
|
|
|
if [ $support8 -ne 0 ] ; then
|
2014-10-31 08:34:34 -04:00
|
|
|
test8=-8
|
2014-07-24 12:32:38 -04:00
|
|
|
fi
|
|
|
|
if [ $support16 -ne 0 ] ; then
|
|
|
|
test16=-16
|
|
|
|
fi
|
|
|
|
if [ $support32 -ne 0 ] ; then
|
|
|
|
test32=-32
|
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Otherwise, select requested bit sizes
|
2014-07-24 12:32:38 -04:00
|
|
|
|
|
|
|
else
|
|
|
|
if [ "$arg8" = yes ] ; then
|
|
|
|
if [ $support8 -eq 0 ] ; then
|
|
|
|
echo "Cannot run 8-bit library tests: 8-bit library not compiled"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-10-31 08:34:34 -04:00
|
|
|
test8=-8
|
2014-07-24 12:32:38 -04:00
|
|
|
fi
|
|
|
|
if [ "$arg16" = yes ] ; then
|
|
|
|
if [ $support16 -eq 0 ] ; then
|
|
|
|
echo "Cannot run 16-bit library tests: 16-bit library not compiled"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
test16=-16
|
|
|
|
fi
|
|
|
|
if [ "$arg32" = yes ] ; then
|
|
|
|
if [ $support32 -eq 0 ] ; then
|
|
|
|
echo "Cannot run 32-bit library tests: 32-bit library not compiled"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
test32=-32
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-09-19 03:43:39 -04:00
|
|
|
# UTF support is implied by Unicode support, and it always applies to all bit
|
|
|
|
# sizes if both are supported; we can't have UTF-8 support without UTF-16 or
|
|
|
|
# UTF-32 support.
|
2014-07-24 12:32:38 -04:00
|
|
|
|
2014-09-19 03:43:39 -04:00
|
|
|
$sim ./pcre2test -C unicode >/dev/null
|
2014-07-24 12:32:38 -04:00
|
|
|
utf=$?
|
|
|
|
|
2015-09-11 12:56:47 -04:00
|
|
|
# When JIT is used with valgrind, we need to set up valgrind suppressions as
|
|
|
|
# otherwise there are a lot of false positive valgrind reports when the
|
|
|
|
# the hardware supports SSE2.
|
|
|
|
|
2014-07-24 12:32:38 -04:00
|
|
|
jitopt=
|
|
|
|
$sim ./pcre2test -C jit >/dev/null
|
|
|
|
jit=$?
|
|
|
|
if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
|
|
|
|
jitopt=-jit
|
2015-09-11 12:56:47 -04:00
|
|
|
if [ "$valgrind" != "" ] ; then
|
|
|
|
vjs="--suppressions=$testdata/valgrind-jit.supp"
|
2015-12-17 13:44:06 -05:00
|
|
|
fi
|
2014-07-24 12:32:38 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# If no specific tests were requested, select all. Those that are not
|
|
|
|
# relevant will be automatically skipped.
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do0 = no -a $do1 = no -a $do2 = no -a $do3 = no -a \
|
|
|
|
$do4 = no -a $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 -a $do14 = no -a $do15 = no -a \
|
2015-08-18 06:34:05 -04:00
|
|
|
$do16 = no -a $do17 = no -a $do18 = no -a $do19 = no -a \
|
2017-05-06 12:19:39 -04:00
|
|
|
$do20 = no -a $do21 = no -a $do22 = no -a $do23 = no -a \
|
|
|
|
$do24 = no -a $do25 = no \
|
2014-07-25 12:35:51 -04:00
|
|
|
]; then
|
2014-10-31 08:34:34 -04:00
|
|
|
do0=yes
|
2014-07-24 12:32:38 -04:00
|
|
|
do1=yes
|
|
|
|
do2=yes
|
2014-07-24 14:01:11 -04:00
|
|
|
do3=yes
|
2014-07-25 12:35:51 -04:00
|
|
|
do4=yes
|
2014-08-03 13:50:08 -04:00
|
|
|
do5=yes
|
|
|
|
do6=yes
|
|
|
|
do7=yes
|
2014-08-05 12:51:32 -04:00
|
|
|
do8=yes
|
|
|
|
do9=yes
|
|
|
|
do10=yes
|
|
|
|
do11=yes
|
|
|
|
do12=yes
|
|
|
|
do13=yes
|
2014-08-08 14:18:18 -04:00
|
|
|
do14=yes
|
|
|
|
do15=yes
|
|
|
|
do16=yes
|
|
|
|
do17=yes
|
2014-10-06 13:28:42 -04:00
|
|
|
do18=yes
|
2015-01-23 11:51:47 -05:00
|
|
|
do19=yes
|
2015-12-17 13:44:06 -05:00
|
|
|
do20=yes
|
|
|
|
do21=yes
|
|
|
|
do22=yes
|
|
|
|
do23=yes
|
2017-05-06 12:19:39 -04:00
|
|
|
do24=yes
|
|
|
|
do25=yes
|
2014-07-24 12:32:38 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Handle any explicit skips at this stage, so that an argument list may consist
|
|
|
|
# only of explicit skips.
|
|
|
|
|
|
|
|
for i in $skip; do eval do$i=no; done
|
|
|
|
|
|
|
|
# Show which release and which test data
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo PCRE2 C library tests using test data from $testdata
|
|
|
|
$sim ./pcre2test /dev/null
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
for bmode in "$test8" "$test16" "$test32"; do
|
|
|
|
case "$bmode" in
|
|
|
|
skip) continue;;
|
|
|
|
-16) if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
|
|
|
|
bits=16; echo "---- Testing 16-bit library ----"; echo "";;
|
|
|
|
-32) if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
|
|
|
|
bits=32; echo "---- Testing 32-bit library ----"; echo "";;
|
2014-10-31 08:34:34 -04:00
|
|
|
-8) bits=8; echo "---- Testing 8-bit library ----"; echo "";;
|
2014-07-24 12:32:38 -04:00
|
|
|
esac
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Test 0 is a special test. Its output is not checked, because it will
|
|
|
|
# be different on different hardware and with different configurations.
|
|
|
|
# Running this test just exercises the code.
|
|
|
|
|
|
|
|
if [ $do0 = yes ] ; then
|
|
|
|
echo $title0
|
2017-03-16 13:55:55 -04:00
|
|
|
echo '/abc/jit,memory,framesize' >testSinput
|
2014-10-31 08:34:34 -04:00
|
|
|
echo ' abc' >>testSinput
|
|
|
|
echo '' >testtry
|
|
|
|
checkspecial '-C'
|
|
|
|
checkspecial '--help'
|
|
|
|
checkspecial '-S 1 -t 10 testSinput'
|
|
|
|
echo " OK"
|
|
|
|
fi
|
2014-07-24 12:32:38 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Primary non-UTF test, compatible with JIT and all versions of Perl >= 5.8
|
|
|
|
|
|
|
|
if [ $do1 = yes ] ; then
|
|
|
|
echo $title1
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput1 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 1 "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-07-24 12:32:38 -04:00
|
|
|
|
2014-11-21 07:19:37 -05:00
|
|
|
# PCRE2 tests that are not Perl-compatible: API, errors, internals
|
2014-07-24 12:32:38 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do2 = yes ] ; then
|
|
|
|
echo $title2 "(excluding UTF-$bits)"
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput2 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $? = 0 ] ; then
|
2017-05-17 13:55:11 -04:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $bmode $opt -error -65,-62,-2,-1,0,100,101,191,192 >>testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 2 "$opt"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2014-07-24 12:32:38 -04:00
|
|
|
|
2015-02-07 12:45:55 -05:00
|
|
|
# Locale-specific tests, provided that either the "fr_FR", "fr_CA", "french"
|
|
|
|
# or "fr" locale is available. The first two are Unix-like standards; the
|
|
|
|
# last two are for Windows. Unfortunately, different versions of the French
|
|
|
|
# locale give different outputs for some items. This test passes if the
|
|
|
|
# output matches any one of the alternative output files.
|
2014-10-31 08:34:34 -04:00
|
|
|
|
|
|
|
if [ $do3 = yes ] ; then
|
2015-02-20 06:20:40 -05:00
|
|
|
locale=
|
|
|
|
|
2015-02-07 12:45:55 -05:00
|
|
|
# In some environments locales that are listed by the "locale -a"
|
|
|
|
# command do not seem to work with setlocale(). Therefore, we do
|
|
|
|
# a preliminary test to see if pcre2test can set one before going
|
2015-02-20 06:20:40 -05:00
|
|
|
# on to use it.
|
2015-02-07 12:45:55 -05:00
|
|
|
|
2015-02-20 06:20:40 -05:00
|
|
|
for loc in 'fr_FR' 'french' 'fr' 'fr_CA'; do
|
2015-02-07 12:45:55 -05:00
|
|
|
locale -a | grep "^$loc\$" >/dev/null
|
2014-07-24 14:01:11 -04:00
|
|
|
if [ $? -eq 0 ] ; then
|
2015-02-07 12:45:55 -05:00
|
|
|
echo "/a/locale=$loc" | \
|
|
|
|
$sim $valgrind ./pcre2test -q $bmode | \
|
|
|
|
grep "Failed to set locale" >/dev/null
|
2015-02-20 06:20:40 -05:00
|
|
|
if [ $? -ne 0 ] ; then
|
2015-02-07 12:45:55 -05:00
|
|
|
locale=$loc
|
|
|
|
if [ "$locale" = "fr_FR" ] ; then
|
|
|
|
infile=$testdata/testinput3
|
|
|
|
outfile=$testdata/testoutput3
|
|
|
|
outfile2=$testdata/testoutput3A
|
|
|
|
outfile3=$testdata/testoutput3B
|
|
|
|
else
|
|
|
|
infile=test3input
|
|
|
|
outfile=test3output
|
|
|
|
outfile2=test3outputA
|
|
|
|
outfile3=test3outputB
|
|
|
|
sed "s/fr_FR/$loc/" $testdata/testinput3 >test3input
|
|
|
|
sed "s/fr_FR/$loc/" $testdata/testoutput3 >test3output
|
|
|
|
sed "s/fr_FR/$loc/" $testdata/testoutput3A >test3outputA
|
|
|
|
sed "s/fr_FR/$loc/" $testdata/testoutput3B >test3outputB
|
2015-02-20 06:20:40 -05:00
|
|
|
fi
|
|
|
|
break
|
|
|
|
fi
|
2014-07-24 14:01:11 -04:00
|
|
|
fi
|
2015-02-20 06:20:40 -05:00
|
|
|
done
|
2014-07-24 14:01:11 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ "$locale" != "" ] ; then
|
|
|
|
echo $title3 "(using '$locale' locale)"
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $infile testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $? = 0 ] ; then
|
|
|
|
case "$opt" in
|
|
|
|
-jit) with=" with JIT";;
|
|
|
|
*) with="";;
|
|
|
|
esac
|
|
|
|
if $cf $outfile testtry >teststdout || \
|
|
|
|
$cf $outfile2 testtry >teststdout || \
|
|
|
|
$cf $outfile3 testtry >teststdout
|
|
|
|
then
|
|
|
|
echo " OK$with"
|
|
|
|
else
|
|
|
|
echo "** Locale test did not run successfully$with. The output did not match"
|
|
|
|
echo " $outfile, $outfile2 or $outfile3."
|
|
|
|
echo " This may mean that there is a problem with the locale settings rather"
|
|
|
|
echo " than a bug in PCRE2."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else exit 1
|
2014-07-24 14:01:11 -04:00
|
|
|
fi
|
2014-10-31 08:34:34 -04:00
|
|
|
done
|
|
|
|
else
|
2015-02-07 12:45:55 -05:00
|
|
|
echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr_CA',"
|
|
|
|
echo "'fr' or 'french' locales can be set, or the \"locale\" command is"
|
2015-02-20 06:20:40 -05:00
|
|
|
echo "not available to check for them."
|
2014-10-31 08:34:34 -04:00
|
|
|
echo " "
|
|
|
|
fi
|
2014-07-24 14:01:11 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for UTF and Unicode property support
|
2014-07-25 12:35:51 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do4 = yes ] ; then
|
|
|
|
echo ${title4A}-${bits}${title4B}
|
|
|
|
if [ $utf -eq 0 ] ; then
|
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
|
|
|
else
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput4 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 4 "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-07-25 12:35:51 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do5 = yes ] ; then
|
|
|
|
echo ${title5A}-${bits}$title5B
|
|
|
|
if [ $utf -eq 0 ] ; then
|
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
|
|
|
else
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput5 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 5 "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-08-03 13:50:08 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for DFA matching support
|
2014-08-03 13:50:08 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do6 = yes ] ; then
|
|
|
|
echo $title6
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput6 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 6 ""
|
2014-08-03 13:50:08 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do7 = yes ] ; then
|
|
|
|
echo ${title7A}-${bits}$title7B
|
|
|
|
if [ $utf -eq 0 ] ; then
|
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput7 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 7 ""
|
|
|
|
fi
|
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Test of internal offsets and code sizes. This test is run only when there
|
2015-11-14 08:22:34 -05:00
|
|
|
# is UTF/UCP support. The actual tests are mostly the same as in some of the
|
|
|
|
# above, but in this test we inspect some offsets and sizes. 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
|
|
|
|
# and for different link sizes, so there are different output files for each
|
|
|
|
# mode and link size.
|
2014-10-31 08:34:34 -04:00
|
|
|
|
|
|
|
if [ $do8 = yes ] ; then
|
|
|
|
echo $title8
|
2015-11-14 08:22:34 -05:00
|
|
|
if [ $utf -eq 0 ] ; then
|
2014-10-31 08:34:34 -04:00
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput8 testtry
|
2015-11-14 08:22:34 -05:00
|
|
|
checkresult $? 8-$bits-$link_size ""
|
2014-10-31 08:34:34 -04:00
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for 8-bit-specific features
|
2014-08-05 12:51:32 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
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
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput9 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 9 "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for UTF-8 and UCP 8-bit-specific features
|
2014-08-05 12:51:32 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
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
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput10 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 10 "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for 16-bit and 32-bit features. Output is different for the two widths.
|
2014-08-05 12:51:32 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do11 = yes ] ; then
|
|
|
|
echo $title11
|
|
|
|
if [ "$bits" = "8" ] ; then
|
|
|
|
echo " Skipped when running 8-bit tests"
|
|
|
|
else
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput11 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 11-$bits "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for 16-bit and 32-bit features with UTF-16/32 and UCP support. Output
|
|
|
|
# is different for the two widths.
|
2014-08-05 12:51:32 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
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
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput12 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 12-$bits "$opt"
|
|
|
|
done
|
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
fi
|
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
# Tests for 16/32-bit-specific features in DFA non-UTF modes
|
2014-08-05 12:51:32 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do13 = yes ] ; then
|
|
|
|
echo $title13
|
|
|
|
if [ "$bits" = "8" ] ; then
|
|
|
|
echo " Skipped when running 8-bit tests"
|
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput13 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 13 ""
|
|
|
|
fi
|
2014-08-05 12:51:32 -04:00
|
|
|
fi
|
2015-12-17 13:44:06 -05:00
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# Tests for DFA UTF and UCP features. Output is different for the different widths.
|
2014-08-08 14:18:18 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do14 = yes ] ; then
|
|
|
|
echo $title14
|
2015-09-08 13:01:17 -04:00
|
|
|
if [ $utf -eq 0 ] ; then
|
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $opt $testdata/testinput14 testtry
|
2015-09-08 13:01:17 -04:00
|
|
|
checkresult $? 14-$bits ""
|
2015-12-17 13:44:06 -05:00
|
|
|
fi
|
2014-10-31 08:34:34 -04:00
|
|
|
fi
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# Test non-JIT match and recursion limits
|
2014-10-06 13:28:42 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do15 = yes ] ; then
|
|
|
|
echo $title15
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput15 testtry
|
2015-08-18 06:34:05 -04:00
|
|
|
checkresult $? 15 ""
|
2014-08-08 14:18:18 -04:00
|
|
|
fi
|
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# Test JIT-specific features when JIT is not available
|
2014-08-08 14:18:18 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do16 = yes ] ; then
|
|
|
|
echo $title16
|
2015-08-18 06:34:05 -04:00
|
|
|
if [ $jit -ne 0 ] ; then
|
|
|
|
echo " Skipped because JIT is available"
|
2014-10-31 08:34:34 -04:00
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput16 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 16 ""
|
|
|
|
fi
|
2014-08-08 14:18:18 -04:00
|
|
|
fi
|
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# Test JIT-specific features when JIT is available
|
2014-08-08 14:18:18 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do17 = yes ] ; then
|
|
|
|
echo $title17
|
2015-08-18 06:34:05 -04:00
|
|
|
if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
|
|
|
|
echo " Skipped because JIT is not available or nojit was specified"
|
2014-10-31 08:34:34 -04:00
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind $vjs ./pcre2test -q $setstack $bmode $testdata/testinput17 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 17 ""
|
|
|
|
fi
|
2014-08-08 14:18:18 -04:00
|
|
|
fi
|
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# Tests for the POSIX interface without UTF/UCP (8-bit only)
|
2014-08-08 14:18:18 -04:00
|
|
|
|
2014-10-31 08:34:34 -04:00
|
|
|
if [ $do18 = yes ] ; then
|
|
|
|
echo $title18
|
|
|
|
if [ "$bits" = "16" -o "$bits" = "32" ] ; then
|
|
|
|
echo " Skipped when running 16/32-bit tests"
|
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput18 testtry
|
2014-10-31 08:34:34 -04:00
|
|
|
checkresult $? 18 ""
|
|
|
|
fi
|
2014-08-08 14:18:18 -04:00
|
|
|
fi
|
|
|
|
|
2015-08-18 06:34:05 -04:00
|
|
|
# Tests for the POSIX interface with UTF/UCP (8-bit only)
|
2015-01-23 11:51:47 -05:00
|
|
|
|
|
|
|
if [ $do19 = yes ] ; then
|
|
|
|
echo $title19
|
2015-08-18 06:34:05 -04:00
|
|
|
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
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput19 testtry
|
2015-08-18 06:34:05 -04:00
|
|
|
checkresult $? 19 ""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Serialization tests
|
|
|
|
|
|
|
|
if [ $do20 = yes ] ; then
|
|
|
|
echo $title20
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ./pcre2test -q $setstack $bmode $testdata/testinput20 testtry
|
2015-08-18 06:34:05 -04:00
|
|
|
checkresult $? 20 ""
|
2015-01-23 11:51:47 -05:00
|
|
|
fi
|
2015-12-17 13:44:06 -05:00
|
|
|
|
2015-10-17 09:50:56 -04:00
|
|
|
# \C tests without UTF - DFA matching is supported
|
|
|
|
|
|
|
|
if [ "$do21" = yes ] ; then
|
|
|
|
echo $title21
|
|
|
|
if [ $supportBSC -eq 0 ] ; then
|
|
|
|
echo " Skipped because \C is disabled"
|
|
|
|
else
|
|
|
|
for opt in "" $jitopt -dfa; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput21 testtry
|
2015-10-17 09:50:56 -04:00
|
|
|
checkresult $? 21 "$opt"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# \C tests with UTF - DFA matching is not supported for \C in UTF mode
|
2015-12-17 13:44:06 -05:00
|
|
|
|
2015-10-17 09:50:56 -04:00
|
|
|
if [ "$do22" = yes ] ; then
|
|
|
|
echo $title22
|
|
|
|
if [ $supportBSC -eq 0 ] ; then
|
|
|
|
echo " Skipped because \C is disabled"
|
2015-10-17 14:27:38 -04:00
|
|
|
elif [ $utf -eq 0 ] ; then
|
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
2015-10-17 09:50:56 -04:00
|
|
|
else
|
|
|
|
for opt in "" $jitopt; do
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput22 testtry
|
2015-10-17 09:50:56 -04:00
|
|
|
checkresult $? 22-$bits "$opt"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Test when \C is disabled
|
2015-12-17 13:44:06 -05:00
|
|
|
|
2015-10-17 09:50:56 -04:00
|
|
|
if [ "$do23" = yes ] ; then
|
|
|
|
echo $title23
|
|
|
|
if [ $supportBSC -ne 0 ] ; then
|
|
|
|
echo " Skipped because \C is not disabled"
|
|
|
|
else
|
2017-03-10 12:48:48 -05:00
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput23 testtry
|
2015-10-17 09:50:56 -04:00
|
|
|
checkresult $? 23 ""
|
|
|
|
fi
|
|
|
|
fi
|
2015-01-23 11:51:47 -05:00
|
|
|
|
2017-05-06 12:19:39 -04:00
|
|
|
# Non-UTF pattern conversion tests
|
|
|
|
|
|
|
|
if [ "$do24" = yes ] ; then
|
|
|
|
echo $title24
|
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput24 testtry
|
|
|
|
checkresult $? 24 ""
|
|
|
|
fi
|
|
|
|
|
|
|
|
# UTF pattern converson tests
|
|
|
|
|
|
|
|
if [ "$do25" = yes ] ; then
|
|
|
|
echo $title25
|
|
|
|
if [ $utf -eq 0 ] ; then
|
|
|
|
echo " Skipped because UTF-$bits support is not available"
|
|
|
|
else
|
|
|
|
$sim $valgrind ${opt:+$vjs} ./pcre2test -q $setstack $bmode $opt $testdata/testinput25 testtry
|
|
|
|
checkresult $? 25 ""
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-07-24 12:32:38 -04:00
|
|
|
# End of loop for 8/16/32-bit tests
|
|
|
|
done
|
|
|
|
|
|
|
|
# Clean up local working files
|
2015-04-18 12:00:35 -04:00
|
|
|
rm -f testSinput test3input testsaved1 testsaved2 test3output test3outputA test3outputB teststdout teststderr testtry
|
2014-07-24 12:32:38 -04:00
|
|
|
|
|
|
|
# End
|