Regex: Update PCRE to v8.35.
I was über lazy at first, so took libs from SM. But actually it's quite easy to compile, so let's update to latest version \o/.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Run the PCRE tests using the pcretest program. The appropriate tests are
|
||||
# selected, depending on which build-time options were used.
|
||||
#
|
||||
@ -13,21 +14,38 @@
|
||||
# UTF-8 with the UTF-8 check turned off; for this, studying must also be
|
||||
# disabled with /SS.
|
||||
#
|
||||
# When JIT support is available, all the tests are also run with -s+ to test
|
||||
# (again, almost) everything with studying and the JIT option. There are also
|
||||
# two tests for JIT-specific features, one to be run when JIT support is
|
||||
# available, and one when it is not.
|
||||
# When JIT support is available, all appropriate tests are also run with -s+ to
|
||||
# test (again, almost) everything with studying and the JIT option, unless
|
||||
# "nojit" is given on the command line. There are also two tests for
|
||||
# JIT-specific features, one to be run when JIT support is available (unless
|
||||
# "nojit" is specified), and one when it is not.
|
||||
#
|
||||
# Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
|
||||
# possible to select which to test by the arguments -8, -16 or -32.
|
||||
# possible to select which to test by giving "-8", "-16" or "-32" on the
|
||||
# command line.
|
||||
#
|
||||
# Other arguments for this script can be individual test numbers, or the word
|
||||
# "valgrind", "valgrind-log" or "sim" followed by an argument to run cross-
|
||||
# compiled executables under a simulator, for example:
|
||||
# As well as "nojit", "-8", "-16", and "-32", arguments for this script are
|
||||
# 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.
|
||||
#
|
||||
# The special argument "3S" runs test 3, stopping if it fails. Test 3 is the
|
||||
# locale test, and failure usually means there's an issue with the locale
|
||||
# rather than a bug in PCRE, so normally subsequent tests are run. "3S" is
|
||||
# useful when you want to debug or update the test.
|
||||
#
|
||||
# Inappropriate tests are automatically skipped (with a comment to say so): for
|
||||
# example, if JIT support is not compiled, test 12 is skipped, whereas if JIT
|
||||
# support is compiled, test 13 is skipped.
|
||||
#
|
||||
# Other arguments can be one of the words "valgrind", "valgrind-log", or "sim"
|
||||
# followed by an argument to run cross-compiled executables under a simulator,
|
||||
# for example:
|
||||
#
|
||||
# RunTest 3 sim "qemu-arm -s 8388608"
|
||||
#
|
||||
#
|
||||
# There are two special cases where only one argument is allowed:
|
||||
#
|
||||
# If the first and only argument is "ebcdic", the script runs the special
|
||||
@ -36,7 +54,7 @@
|
||||
#
|
||||
# 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.
|
||||
@ -53,8 +71,8 @@ title8="Test 8: DFA matching main functionality"
|
||||
title9="Test 9: DFA matching with UTF"
|
||||
title10="Test 10: DFA matching with Unicode properties"
|
||||
title11="Test 11: Internal offsets and code size tests"
|
||||
title12="Test 12: JIT-specific features (JIT available)"
|
||||
title13="Test 13: JIT-specific features (JIT not available)"
|
||||
title12="Test 12: JIT-specific features (when JIT is available)"
|
||||
title13="Test 13: JIT-specific features (when JIT is not available)"
|
||||
title14="Test 14: Specials for the basic 8-bit library"
|
||||
title15="Test 15: Specials for the 8-bit library with UTF-8 support"
|
||||
title16="Test 16: Specials for the 8-bit library with Unicode propery support"
|
||||
@ -69,6 +87,8 @@ title24="Test 24: Specials for the 16-bit library with UTF-16 support"
|
||||
title25="Test 25: Specials for the 32-bit library"
|
||||
title26="Test 26: Specials for the 32-bit library with UTF-32 support"
|
||||
|
||||
maxtest=26
|
||||
|
||||
if [ $# -eq 1 -a "$1" = "list" ]; then
|
||||
echo $title1
|
||||
echo $title2 "(not UTF)"
|
||||
@ -151,17 +171,19 @@ fi
|
||||
|
||||
# Default values
|
||||
|
||||
valgrind=
|
||||
sim=
|
||||
arg8=
|
||||
arg16=
|
||||
arg32=
|
||||
nojit=
|
||||
sim=
|
||||
skip=
|
||||
valgrind=
|
||||
|
||||
# This is in case the caller has set aliases (as I do - PH)
|
||||
unset cp ls mv rm
|
||||
|
||||
# Select which tests to run; for those that are explicitly requested, check
|
||||
# that the necessary optional facilities are available.
|
||||
# Process options and select which tests to run; for those that are explicitly
|
||||
# requested, check that the necessary optional facilities are available.
|
||||
|
||||
do1=no
|
||||
do2=no
|
||||
@ -221,10 +243,34 @@ while [ $# -gt 0 ] ; do
|
||||
-8) arg8=yes;;
|
||||
-16) arg16=yes;;
|
||||
-32) arg32=yes;;
|
||||
nojit) nojit=yes;;
|
||||
sim) shift; sim=$1;;
|
||||
valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
|
||||
valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
|
||||
sim) shift; sim=$1;;
|
||||
*) echo "Unknown test number '$1'"; exit 1;;
|
||||
~*)
|
||||
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
|
||||
if expr \( "$tf" "<" 1 \) \| \( "$tt" ">" "$maxtest" \) >/dev/null; then
|
||||
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
|
||||
@ -309,79 +355,12 @@ ucp=$?
|
||||
jitopt=
|
||||
$sim ./pcretest -C jit >/dev/null
|
||||
jit=$?
|
||||
if [ $jit -ne 0 ] ; then
|
||||
if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
|
||||
jitopt=-s+
|
||||
fi
|
||||
|
||||
if [ $utf -eq 0 ] ; then
|
||||
if [ $do4 = yes ] ; then
|
||||
echo "Can't run test 4 because UTF support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do5 = yes ] ; then
|
||||
echo "Can't run test 5 because UTF support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do9 = yes ] ; then
|
||||
echo "Can't run test 8 because UTF support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do15 = yes ] ; then
|
||||
echo "Can't run test 15 because UTF support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do18 = yes ] ; then
|
||||
echo "Can't run test 18 because UTF support is not configured"
|
||||
fi
|
||||
if [ $do22 = yes ] ; then
|
||||
echo "Can't run test 22 because UTF support is not configured"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $ucp -eq 0 ] ; then
|
||||
if [ $do6 = yes ] ; then
|
||||
echo "Can't run test 6 because Unicode property support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do7 = yes ] ; then
|
||||
echo "Can't run test 7 because Unicode property support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do10 = yes ] ; then
|
||||
echo "Can't run test 10 because Unicode property support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do16 = yes ] ; then
|
||||
echo "Can't run test 16 because Unicode property support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
if [ $do19 = yes ] ; then
|
||||
echo "Can't run test 19 because Unicode property support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $link_size -ne 2 ] ; then
|
||||
if [ $do11 = yes ] ; then
|
||||
echo "Can't run test 11 because the link size ($link_size) is not 2"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $jit -eq 0 ] ; then
|
||||
if [ $do12 = "yes" ] ; then
|
||||
echo "Can't run test 12 because JIT support is not configured"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if [ $do13 = "yes" ] ; then
|
||||
echo "Can't run test 13 because JIT support is configured"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# If no specific tests were requested, select all. Those that are not
|
||||
# relevant will be skipped.
|
||||
# relevant will be automatically skipped.
|
||||
|
||||
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
|
||||
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
|
||||
@ -418,6 +397,11 @@ if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
|
||||
do26=yes
|
||||
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 ""
|
||||
@ -479,8 +463,9 @@ fi
|
||||
|
||||
# Locale-specific tests, provided that either the "fr_FR" or the "french"
|
||||
# locale is available. The former is the Unix-like standard; the latter is
|
||||
# for Windows. Another possibility is "fr", which needs to be run against
|
||||
# the Windows-specific input and output files.
|
||||
# for Windows. Another possibility is "fr". 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.
|
||||
|
||||
if [ $do3 = yes ] ; then
|
||||
locale -a | grep '^fr_FR$' >/dev/null
|
||||
@ -488,20 +473,28 @@ if [ $do3 = yes ] ; then
|
||||
locale=fr_FR
|
||||
infile=$testdata/testinput3
|
||||
outfile=$testdata/testoutput3
|
||||
outfile2=$testdata/testoutput3A
|
||||
outfile3=$testdata/testoutput3B
|
||||
else
|
||||
infile=test3input
|
||||
outfile=test3output
|
||||
outfile2=test3outputA
|
||||
outfile3=test3outputB
|
||||
locale -a | grep '^french$' >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
locale=french
|
||||
sed 's/fr_FR/french/' $testdata/testinput3 >test3input
|
||||
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
|
||||
sed 's/fr_FR/french/' $testdata/testoutput3A >test3outputA
|
||||
sed 's/fr_FR/french/' $testdata/testoutput3B >test3outputB
|
||||
else
|
||||
locale -a | grep '^fr$' >/dev/null
|
||||
if [ $? -eq 0 ] ; then
|
||||
locale=fr
|
||||
sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
|
||||
sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
|
||||
sed 's/fr_FR/fr/' $testdata/intestinput3 >test3input
|
||||
sed 's/fr_FR/fr/' $testdata/intestoutput3 >test3output
|
||||
sed 's/fr_FR/fr/' $testdata/intestoutput3A >test3outputA
|
||||
sed 's/fr_FR/fr/' $testdata/intestoutput3B >test3outputB
|
||||
else
|
||||
locale=
|
||||
fi
|
||||
@ -513,18 +506,20 @@ if [ $do3 = yes ] ; then
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $infile testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $outfile testtry
|
||||
if [ $? != 0 ] ; then
|
||||
echo " "
|
||||
echo "Locale test did not run entirely successfully."
|
||||
echo "This usually means that there is a problem with the locale"
|
||||
echo "settings rather than a bug in PCRE."
|
||||
break;
|
||||
else
|
||||
if $cf $outfile testtry >teststdout || \
|
||||
$cf $outfile2 testtry >teststdout || \
|
||||
$cf $outfile3 testtry >teststdout
|
||||
then
|
||||
if [ "$opt" = "-s" ] ; then echo " OK with study"
|
||||
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
|
||||
else echo " OK"
|
||||
fi
|
||||
else
|
||||
echo "** Locale test did not run successfully. 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 PCRE."
|
||||
exit 1
|
||||
fi
|
||||
else exit 1
|
||||
fi
|
||||
@ -700,7 +695,7 @@ fi
|
||||
|
||||
if [ $do12 = yes ] ; then
|
||||
echo $title12
|
||||
if [ $jit -eq 0 ] ; then
|
||||
if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
|
||||
echo " Skipped because JIT is not available or not usable"
|
||||
else
|
||||
$sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
|
||||
@ -1010,6 +1005,6 @@ fi
|
||||
done
|
||||
|
||||
# Clean up local working files
|
||||
rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
|
||||
rm -f test3input test3output test3outputA testNinput testsaved* teststderr teststdout testtry
|
||||
|
||||
# End
|
||||
|
Reference in New Issue
Block a user