| 1 |
nigel |
49 |
#! /bin/sh |
| 2 |
|
|
|
| 3 |
ph10 |
1283 |
############################################################################### |
| 4 |
ph10 |
671 |
# Run the PCRE tests using the pcretest program. The appropriate tests are |
| 5 |
|
|
# selected, depending on which build-time options were used. |
| 6 |
ph10 |
1033 |
# |
| 7 |
ph10 |
671 |
# 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 |
| 15 |
|
|
# disabled with /SS. |
| 16 |
ph10 |
1033 |
# |
| 17 |
ph10 |
671 |
# When JIT support is available, all the tests are also run with -s+ to test |
| 18 |
ph10 |
1251 |
# (again, almost) everything with studying and the JIT option, unless "nojit" |
| 19 |
ph10 |
1320 |
# is given on the command line. There are also two tests for JIT-specific |
| 20 |
ph10 |
1251 |
# features, one to be run when JIT support is available (unless "nojit" is |
| 21 |
|
|
# specified), and one when it is not. |
| 22 |
ph10 |
1033 |
# |
| 23 |
chpe |
1055 |
# Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also |
| 24 |
ph10 |
1283 |
# possible to select which to test by giving "-8", "-16" or "-32" on the |
| 25 |
|
|
# command line. |
| 26 |
ph10 |
1033 |
# |
| 27 |
ph10 |
1283 |
# 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 |
| 32 |
|
|
# in numerical order. |
| 33 |
|
|
|
| 34 |
|
|
# Other arguments can be one of the words "valgrind", "valgrind-log", or "sim" |
| 35 |
|
|
# followed by an argument to run cross- compiled executables under a simulator, |
| 36 |
|
|
# for example: |
| 37 |
ph10 |
689 |
# |
| 38 |
|
|
# RunTest 3 sim "qemu-arm -s 8388608" |
| 39 |
ph10 |
931 |
# |
| 40 |
ph10 |
1033 |
# There are two special cases where only one argument is allowed: |
| 41 |
|
|
# |
| 42 |
|
|
# If the first and only argument is "ebcdic", the script runs the special |
| 43 |
|
|
# EBCDIC test that can be useful for checking certain EBCDIC features, even |
| 44 |
|
|
# when run in an ASCII environment. |
| 45 |
|
|
# |
| 46 |
|
|
# If the script is obeyed as "RunTest list", a list of available tests is |
| 47 |
|
|
# output, but none of them are run. |
| 48 |
ph10 |
1283 |
############################################################################### |
| 49 |
ph10 |
689 |
|
| 50 |
ph10 |
931 |
# Define test titles in variables so that they can be output as a list. Some |
| 51 |
|
|
# of them are modified (e.g. with -8 or -16) when used in the actual tests. |
| 52 |
|
|
|
| 53 |
|
|
title1="Test 1: Main functionality (Compatible with Perl >= 5.10)" |
| 54 |
|
|
title2="Test 2: API, errors, internals, and non-Perl stuff" |
| 55 |
|
|
title3="Test 3: Locale-specific features" |
| 56 |
|
|
title4A="Test 4: UTF" |
| 57 |
|
|
title4B=" support (Compatible with Perl >= 5.10)" |
| 58 |
|
|
title5="Test 5: API, internals, and non-Perl stuff for UTF" |
| 59 |
|
|
title6="Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
| 60 |
|
|
title7="Test 7: API, internals, and non-Perl stuff for Unicode property support" |
| 61 |
|
|
title8="Test 8: DFA matching main functionality" |
| 62 |
|
|
title9="Test 9: DFA matching with UTF" |
| 63 |
|
|
title10="Test 10: DFA matching with Unicode properties" |
| 64 |
|
|
title11="Test 11: Internal offsets and code size tests" |
| 65 |
|
|
title12="Test 12: JIT-specific features (JIT available)" |
| 66 |
|
|
title13="Test 13: JIT-specific features (JIT not available)" |
| 67 |
|
|
title14="Test 14: Specials for the basic 8-bit library" |
| 68 |
|
|
title15="Test 15: Specials for the 8-bit library with UTF-8 support" |
| 69 |
|
|
title16="Test 16: Specials for the 8-bit library with Unicode propery support" |
| 70 |
chpe |
1055 |
title17="Test 17: Specials for the basic 16/32-bit library" |
| 71 |
|
|
title18="Test 18: Specials for the 16/32-bit library with UTF-16/32 support" |
| 72 |
|
|
title19="Test 19: Specials for the 16/32-bit library with Unicode property support" |
| 73 |
|
|
title20="Test 20: DFA specials for the basic 16/32-bit library" |
| 74 |
|
|
title21="Test 21: Reloads for the basic 16/32-bit library" |
| 75 |
|
|
title22="Test 22: Reloads for the 16/32-bit library with UTF-16/32 support" |
| 76 |
|
|
title23="Test 23: Specials for the 16-bit library" |
| 77 |
|
|
title24="Test 24: Specials for the 16-bit library with UTF-16 support" |
| 78 |
|
|
title25="Test 25: Specials for the 32-bit library" |
| 79 |
|
|
title26="Test 26: Specials for the 32-bit library with UTF-32 support" |
| 80 |
ph10 |
931 |
|
| 81 |
ph10 |
1283 |
maxtest=26 |
| 82 |
|
|
|
| 83 |
ph10 |
931 |
if [ $# -eq 1 -a "$1" = "list" ]; then |
| 84 |
|
|
echo $title1 |
| 85 |
|
|
echo $title2 "(not UTF)" |
| 86 |
|
|
echo $title3 |
| 87 |
|
|
echo $title4A $title4B |
| 88 |
|
|
echo $title5 support |
| 89 |
|
|
echo $title6 |
| 90 |
|
|
echo $title7 |
| 91 |
|
|
echo $title8 |
| 92 |
|
|
echo $title9 |
| 93 |
|
|
echo $title10 |
| 94 |
|
|
echo $title11 |
| 95 |
|
|
echo $title12 |
| 96 |
|
|
echo $title13 |
| 97 |
|
|
echo $title14 |
| 98 |
|
|
echo $title15 |
| 99 |
|
|
echo $title16 |
| 100 |
|
|
echo $title17 |
| 101 |
|
|
echo $title18 |
| 102 |
|
|
echo $title19 |
| 103 |
|
|
echo $title20 |
| 104 |
|
|
echo $title21 |
| 105 |
|
|
echo $title22 |
| 106 |
chpe |
1055 |
echo $title23 |
| 107 |
|
|
echo $title24 |
| 108 |
|
|
echo $title25 |
| 109 |
|
|
echo $title26 |
| 110 |
ph10 |
931 |
exit 0 |
| 111 |
|
|
fi |
| 112 |
|
|
|
| 113 |
ph10 |
1033 |
# Set up a suitable "diff" command for comparison. Some systems |
| 114 |
|
|
# have a diff that lacks a -u option. Try to deal with this. |
| 115 |
|
|
|
| 116 |
|
|
cf="diff" |
| 117 |
|
|
diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u" |
| 118 |
|
|
|
| 119 |
|
|
# Find the test data |
| 120 |
|
|
|
| 121 |
|
|
if [ -n "$srcdir" -a -d "$srcdir" ] ; then |
| 122 |
|
|
testdata="$srcdir/testdata" |
| 123 |
|
|
elif [ -d "./testdata" ] ; then |
| 124 |
|
|
testdata=./testdata |
| 125 |
|
|
elif [ -d "../testdata" ] ; then |
| 126 |
|
|
testdata=../testdata |
| 127 |
|
|
else |
| 128 |
|
|
echo "Cannot find the testdata directory" |
| 129 |
|
|
exit 1 |
| 130 |
|
|
fi |
| 131 |
|
|
|
| 132 |
|
|
|
| 133 |
|
|
# ------ Special EBCDIC Test ------- |
| 134 |
|
|
|
| 135 |
|
|
if [ $# -eq 1 -a "$1" = "ebcdic" ]; then |
| 136 |
|
|
./pcretest -C ebcdic >/dev/null |
| 137 |
|
|
ebcdic=$? |
| 138 |
|
|
if [ $ebcdic -ne 1 ] ; then |
| 139 |
|
|
echo "Cannot run EBCDIC tests: EBCDIC support not compiled" |
| 140 |
|
|
exit 1 |
| 141 |
ph10 |
1221 |
fi |
| 142 |
ph10 |
1033 |
|
| 143 |
|
|
for opt in "" "-s" "-dfa" "-s -dfa"; do |
| 144 |
|
|
./pcretest -q $opt $testdata/testinputEBC >testtry |
| 145 |
|
|
if [ $? = 0 ] ; then |
| 146 |
|
|
$cf $testdata/testoutputEBC testtry |
| 147 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 148 |
|
|
else exit 1 |
| 149 |
|
|
fi |
| 150 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 151 |
|
|
elif [ "$opt" = "-dfa" ] ; then echo " OK using DFA" |
| 152 |
ph10 |
1221 |
elif [ "$opt" = "-s -dfa" ] ; then echo " OK using DFA with study" |
| 153 |
ph10 |
1033 |
else echo " OK" |
| 154 |
|
|
fi |
| 155 |
|
|
done |
| 156 |
|
|
|
| 157 |
|
|
exit 0 |
| 158 |
|
|
fi |
| 159 |
|
|
|
| 160 |
|
|
|
| 161 |
ph10 |
1221 |
# ------ Normal Tests ------ |
| 162 |
ph10 |
1033 |
|
| 163 |
ph10 |
931 |
# Default values |
| 164 |
|
|
|
| 165 |
ph10 |
836 |
arg8= |
| 166 |
|
|
arg16= |
| 167 |
chpe |
1055 |
arg32= |
| 168 |
ph10 |
1251 |
nojit= |
| 169 |
|
|
sim= |
| 170 |
ph10 |
1283 |
skip= |
| 171 |
ph10 |
1251 |
valgrind= |
| 172 |
ph10 |
339 |
|
| 173 |
ph10 |
842 |
# This is in case the caller has set aliases (as I do - PH) |
| 174 |
|
|
unset cp ls mv rm |
| 175 |
|
|
|
| 176 |
ph10 |
1283 |
# Process options and select which tests to run; for those that are explicitly |
| 177 |
|
|
# requested, check that the necessary optional facilities are available. |
| 178 |
ph10 |
116 |
|
| 179 |
nigel |
49 |
do1=no |
| 180 |
|
|
do2=no |
| 181 |
|
|
do3=no |
| 182 |
|
|
do4=no |
| 183 |
|
|
do5=no |
| 184 |
nigel |
75 |
do6=no |
| 185 |
nigel |
77 |
do7=no |
| 186 |
|
|
do8=no |
| 187 |
|
|
do9=no |
| 188 |
ph10 |
164 |
do10=no |
| 189 |
ph10 |
448 |
do11=no |
| 190 |
|
|
do12=no |
| 191 |
ph10 |
651 |
do13=no |
| 192 |
ph10 |
671 |
do14=no |
| 193 |
|
|
do15=no |
| 194 |
ph10 |
836 |
do16=no |
| 195 |
|
|
do17=no |
| 196 |
|
|
do18=no |
| 197 |
|
|
do19=no |
| 198 |
|
|
do20=no |
| 199 |
ph10 |
897 |
do21=no |
| 200 |
|
|
do22=no |
| 201 |
chpe |
1055 |
do23=no |
| 202 |
|
|
do24=no |
| 203 |
|
|
do25=no |
| 204 |
|
|
do26=no |
| 205 |
nigel |
49 |
|
| 206 |
|
|
while [ $# -gt 0 ] ; do |
| 207 |
|
|
case $1 in |
| 208 |
|
|
1) do1=yes;; |
| 209 |
|
|
2) do2=yes;; |
| 210 |
|
|
3) do3=yes;; |
| 211 |
|
|
4) do4=yes;; |
| 212 |
nigel |
77 |
5) do5=yes;; |
| 213 |
|
|
6) do6=yes;; |
| 214 |
|
|
7) do7=yes;; |
| 215 |
|
|
8) do8=yes;; |
| 216 |
|
|
9) do9=yes;; |
| 217 |
ph10 |
165 |
10) do10=yes;; |
| 218 |
ph10 |
448 |
11) do11=yes;; |
| 219 |
ph10 |
461 |
12) do12=yes;; |
| 220 |
ph10 |
666 |
13) do13=yes;; |
| 221 |
ph10 |
671 |
14) do14=yes;; |
| 222 |
|
|
15) do15=yes;; |
| 223 |
ph10 |
836 |
16) do16=yes;; |
| 224 |
|
|
17) do17=yes;; |
| 225 |
|
|
18) do18=yes;; |
| 226 |
|
|
19) do19=yes;; |
| 227 |
ph10 |
842 |
20) do20=yes;; |
| 228 |
ph10 |
897 |
21) do21=yes;; |
| 229 |
|
|
22) do22=yes;; |
| 230 |
chpe |
1055 |
23) do23=yes;; |
| 231 |
|
|
24) do24=yes;; |
| 232 |
|
|
25) do25=yes;; |
| 233 |
|
|
26) do26=yes;; |
| 234 |
ph10 |
836 |
-8) arg8=yes;; |
| 235 |
|
|
-16) arg16=yes;; |
| 236 |
chpe |
1055 |
-32) arg32=yes;; |
| 237 |
ph10 |
1320 |
nojit) nojit=yes;; |
| 238 |
ph10 |
1251 |
sim) shift; sim=$1;; |
| 239 |
chpe |
1173 |
valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";; |
| 240 |
|
|
valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";; |
| 241 |
ph10 |
1283 |
~*) |
| 242 |
|
|
if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then |
| 243 |
|
|
skip="$skip `expr "$1" : '~\([0-9]*\)*$'`" |
| 244 |
|
|
else |
| 245 |
|
|
echo "Unknown option or test selector '$1'"; exit 1 |
| 246 |
ph10 |
1320 |
fi |
| 247 |
|
|
;; |
| 248 |
ph10 |
1283 |
*-*) |
| 249 |
|
|
if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then |
| 250 |
ph10 |
1320 |
tf=`expr "$1" : '\([0-9]*\)'` |
| 251 |
ph10 |
1283 |
tt=`expr "$1" : '.*-\([0-9]*\)'` |
| 252 |
ph10 |
1320 |
if [ "$tt" = "" ] ; then tt=$maxtest; fi |
| 253 |
ph10 |
1283 |
if expr \( "$tf" "<" 1 \) \| \( "$tt" ">" "$maxtest" \) >/dev/null; then |
| 254 |
|
|
echo "Invalid test range '$1'"; exit 1 |
| 255 |
ph10 |
1320 |
fi |
| 256 |
ph10 |
1283 |
while expr "$tf" "<=" "$tt" >/dev/null; do |
| 257 |
|
|
eval do${tf}=yes |
| 258 |
ph10 |
1320 |
tf=`expr $tf + 1` |
| 259 |
ph10 |
1283 |
done |
| 260 |
|
|
else |
| 261 |
|
|
echo "Invalid test range '$1'"; exit 1 |
| 262 |
ph10 |
1320 |
fi |
| 263 |
ph10 |
1283 |
;; |
| 264 |
|
|
*) echo "Unknown option or test selector '$1'"; exit 1;; |
| 265 |
nigel |
49 |
esac |
| 266 |
|
|
shift |
| 267 |
|
|
done |
| 268 |
|
|
|
| 269 |
ph10 |
1221 |
# Find which optional facilities are available. |
| 270 |
ph10 |
689 |
|
| 271 |
ph10 |
836 |
$sim ./pcretest -C linksize >/dev/null |
| 272 |
|
|
link_size=$? |
| 273 |
|
|
if [ $link_size -lt 2 ] ; then |
| 274 |
|
|
echo "Failed to find internal link size" |
| 275 |
|
|
exit 1 |
| 276 |
|
|
fi |
| 277 |
|
|
if [ $link_size -gt 4 ] ; then |
| 278 |
|
|
echo "Failed to find internal link size" |
| 279 |
|
|
exit 1 |
| 280 |
|
|
fi |
| 281 |
ph10 |
689 |
|
| 282 |
ph10 |
1123 |
# All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only |
| 283 |
|
|
# one need be. |
| 284 |
ph10 |
689 |
|
| 285 |
ph10 |
836 |
$sim ./pcretest -C pcre8 >/dev/null |
| 286 |
|
|
support8=$? |
| 287 |
|
|
$sim ./pcretest -C pcre16 >/dev/null |
| 288 |
|
|
support16=$? |
| 289 |
chpe |
1055 |
$sim ./pcretest -C pcre32 >/dev/null |
| 290 |
|
|
support32=$? |
| 291 |
|
|
|
| 292 |
ph10 |
1123 |
# Initialize all bitsizes skipped |
| 293 |
|
|
|
| 294 |
|
|
test8=skip |
| 295 |
|
|
test16=skip |
| 296 |
|
|
test32=skip |
| 297 |
|
|
|
| 298 |
|
|
# If no bitsize arguments, select all that are available |
| 299 |
|
|
|
| 300 |
|
|
if [ "$arg8$arg16$arg32" = "" ] ; then |
| 301 |
ph10 |
836 |
if [ $support8 -ne 0 ] ; then |
| 302 |
|
|
test8= |
| 303 |
ph10 |
1221 |
fi |
| 304 |
ph10 |
1123 |
if [ $support16 -ne 0 ] ; then |
| 305 |
|
|
test16=-16 |
| 306 |
ph10 |
1221 |
fi |
| 307 |
ph10 |
1123 |
if [ $support32 -ne 0 ] ; then |
| 308 |
|
|
test32=-32 |
| 309 |
ph10 |
1221 |
fi |
| 310 |
ph10 |
1123 |
|
| 311 |
|
|
# Select requested bit sizes |
| 312 |
|
|
|
| 313 |
|
|
else |
| 314 |
|
|
if [ "$arg8" = yes ] ; then |
| 315 |
|
|
if [ $support8 -eq 0 ] ; then |
| 316 |
ph10 |
836 |
echo "Cannot run 8-bit library tests: 8-bit library not compiled" |
| 317 |
|
|
exit 1 |
| 318 |
|
|
fi |
| 319 |
ph10 |
1123 |
test8= |
| 320 |
ph10 |
1221 |
fi |
| 321 |
ph10 |
1123 |
if [ "$arg16" = yes ] ; then |
| 322 |
|
|
if [ $support16 -eq 0 ] ; then |
| 323 |
|
|
echo "Cannot run 16-bit library tests: 16-bit library not compiled" |
| 324 |
chpe |
1055 |
exit 1 |
| 325 |
|
|
fi |
| 326 |
ph10 |
836 |
test16=-16 |
| 327 |
ph10 |
1221 |
fi |
| 328 |
ph10 |
1123 |
if [ "$arg32" = yes ] ; then |
| 329 |
|
|
if [ $support32 -eq 0 ] ; then |
| 330 |
|
|
echo "Cannot run 32-bit library tests: 32-bit library not compiled" |
| 331 |
chpe |
1055 |
exit 1 |
| 332 |
|
|
fi |
| 333 |
|
|
test32=-32 |
| 334 |
ph10 |
1221 |
fi |
| 335 |
ph10 |
836 |
fi |
| 336 |
|
|
|
| 337 |
ph10 |
1123 |
# UTF support always applies to all bit sizes if both are supported; we can't |
| 338 |
ph10 |
836 |
# have UTF-8 support without UTF-16 support (for example). |
| 339 |
|
|
|
| 340 |
|
|
$sim ./pcretest -C utf >/dev/null |
| 341 |
|
|
utf=$? |
| 342 |
|
|
|
| 343 |
|
|
$sim ./pcretest -C ucp >/dev/null |
| 344 |
ph10 |
689 |
ucp=$? |
| 345 |
|
|
|
| 346 |
|
|
jitopt= |
| 347 |
ph10 |
836 |
$sim ./pcretest -C jit >/dev/null |
| 348 |
ph10 |
689 |
jit=$? |
| 349 |
ph10 |
1251 |
if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then |
| 350 |
ph10 |
689 |
jitopt=-s+ |
| 351 |
|
|
fi |
| 352 |
|
|
|
| 353 |
ph10 |
1283 |
# Handle any explicit skips |
| 354 |
|
|
|
| 355 |
|
|
for i in $skip; do eval do$i=no; done |
| 356 |
|
|
|
| 357 |
|
|
# If any unsuitable tests were explicitly requested, grumble. |
| 358 |
|
|
|
| 359 |
ph10 |
836 |
if [ $utf -eq 0 ] ; then |
| 360 |
nigel |
63 |
if [ $do4 = yes ] ; then |
| 361 |
ph10 |
836 |
echo "Can't run test 4 because UTF support is not configured" |
| 362 |
nigel |
63 |
exit 1 |
| 363 |
nigel |
77 |
fi |
| 364 |
nigel |
49 |
if [ $do5 = yes ] ; then |
| 365 |
ph10 |
836 |
echo "Can't run test 5 because UTF support is not configured" |
| 366 |
nigel |
49 |
exit 1 |
| 367 |
nigel |
77 |
fi |
| 368 |
ph10 |
836 |
if [ $do9 = yes ] ; then |
| 369 |
|
|
echo "Can't run test 8 because UTF support is not configured" |
| 370 |
nigel |
77 |
exit 1 |
| 371 |
|
|
fi |
| 372 |
ph10 |
836 |
if [ $do15 = yes ] ; then |
| 373 |
|
|
echo "Can't run test 15 because UTF support is not configured" |
| 374 |
ph10 |
651 |
exit 1 |
| 375 |
|
|
fi |
| 376 |
ph10 |
836 |
if [ $do18 = yes ] ; then |
| 377 |
|
|
echo "Can't run test 18 because UTF support is not configured" |
| 378 |
ph10 |
842 |
fi |
| 379 |
ph10 |
897 |
if [ $do22 = yes ] ; then |
| 380 |
|
|
echo "Can't run test 22 because UTF support is not configured" |
| 381 |
|
|
fi |
| 382 |
nigel |
77 |
fi |
| 383 |
nigel |
49 |
|
| 384 |
ph10 |
116 |
if [ $ucp -eq 0 ] ; then |
| 385 |
nigel |
75 |
if [ $do6 = yes ] ; then |
| 386 |
|
|
echo "Can't run test 6 because Unicode property support is not configured" |
| 387 |
|
|
exit 1 |
| 388 |
|
|
fi |
| 389 |
ph10 |
836 |
if [ $do7 = yes ] ; then |
| 390 |
|
|
echo "Can't run test 7 because Unicode property support is not configured" |
| 391 |
nigel |
77 |
exit 1 |
| 392 |
|
|
fi |
| 393 |
ph10 |
164 |
if [ $do10 = yes ] ; then |
| 394 |
|
|
echo "Can't run test 10 because Unicode property support is not configured" |
| 395 |
|
|
exit 1 |
| 396 |
|
|
fi |
| 397 |
ph10 |
836 |
if [ $do16 = yes ] ; then |
| 398 |
|
|
echo "Can't run test 16 because Unicode property support is not configured" |
| 399 |
ph10 |
448 |
exit 1 |
| 400 |
|
|
fi |
| 401 |
ph10 |
836 |
if [ $do19 = yes ] ; then |
| 402 |
|
|
echo "Can't run test 19 because Unicode property support is not configured" |
| 403 |
|
|
exit 1 |
| 404 |
|
|
fi |
| 405 |
nigel |
77 |
fi |
| 406 |
nigel |
75 |
|
| 407 |
ph10 |
164 |
if [ $link_size -ne 2 ] ; then |
| 408 |
ph10 |
836 |
if [ $do11 = yes ] ; then |
| 409 |
|
|
echo "Can't run test 11 because the link size ($link_size) is not 2" |
| 410 |
ph10 |
164 |
exit 1 |
| 411 |
|
|
fi |
| 412 |
ph10 |
165 |
fi |
| 413 |
ph10 |
164 |
|
| 414 |
ph10 |
671 |
if [ $jit -eq 0 ] ; then |
| 415 |
ph10 |
836 |
if [ $do12 = "yes" ] ; then |
| 416 |
|
|
echo "Can't run test 12 because JIT support is not configured" |
| 417 |
ph10 |
671 |
exit 1 |
| 418 |
|
|
fi |
| 419 |
|
|
else |
| 420 |
ph10 |
836 |
if [ $do13 = "yes" ] ; then |
| 421 |
|
|
echo "Can't run test 13 because JIT support is configured" |
| 422 |
ph10 |
671 |
exit 1 |
| 423 |
|
|
fi |
| 424 |
ph10 |
674 |
fi |
| 425 |
ph10 |
116 |
|
| 426 |
ph10 |
671 |
# If no specific tests were requested, select all. Those that are not |
| 427 |
ph10 |
1283 |
# relevant will be automatically skipped. |
| 428 |
ph10 |
671 |
|
| 429 |
|
|
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
| 430 |
|
|
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
| 431 |
|
|
$do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \ |
| 432 |
ph10 |
836 |
$do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \ |
| 433 |
ph10 |
897 |
$do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \ |
| 434 |
chpe |
1055 |
$do21 = no -a $do22 = no -a $do23 = no -a $do24 = no -a \ |
| 435 |
|
|
$do25 = no -a $do26 = no ] ; then |
| 436 |
nigel |
49 |
do1=yes |
| 437 |
ph10 |
247 |
do2=yes |
| 438 |
nigel |
49 |
do3=yes |
| 439 |
ph10 |
671 |
do4=yes |
| 440 |
|
|
do5=yes |
| 441 |
|
|
do6=yes |
| 442 |
ph10 |
247 |
do7=yes |
| 443 |
ph10 |
671 |
do8=yes |
| 444 |
|
|
do9=yes |
| 445 |
|
|
do10=yes |
| 446 |
ph10 |
448 |
do11=yes |
| 447 |
ph10 |
671 |
do12=yes |
| 448 |
|
|
do13=yes |
| 449 |
|
|
do14=yes |
| 450 |
|
|
do15=yes |
| 451 |
ph10 |
836 |
do16=yes |
| 452 |
|
|
do17=yes |
| 453 |
|
|
do18=yes |
| 454 |
|
|
do19=yes |
| 455 |
ph10 |
842 |
do20=yes |
| 456 |
ph10 |
897 |
do21=yes |
| 457 |
ph10 |
903 |
do22=yes |
| 458 |
chpe |
1055 |
do23=yes |
| 459 |
|
|
do24=yes |
| 460 |
|
|
do25=yes |
| 461 |
|
|
do26=yes |
| 462 |
nigel |
49 |
fi |
| 463 |
|
|
|
| 464 |
ph10 |
1283 |
# Handle any explicit skips (again, so that an argument list may consist only |
| 465 |
|
|
# of explicit skips). |
| 466 |
|
|
|
| 467 |
|
|
for i in $skip; do eval do$i=no; done |
| 468 |
|
|
|
| 469 |
ph10 |
706 |
# Show which release and which test data |
| 470 |
nigel |
73 |
|
| 471 |
ph10 |
128 |
echo "" |
| 472 |
ph10 |
706 |
echo PCRE C library tests using test data from $testdata |
| 473 |
|
|
$sim ./pcretest /dev/null |
| 474 |
nigel |
73 |
|
| 475 |
chpe |
1200 |
for bmode in "$test8" "$test16" "$test32"; do |
| 476 |
ph10 |
836 |
case "$bmode" in |
| 477 |
|
|
skip) continue;; |
| 478 |
chpe |
1055 |
-16) if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi |
| 479 |
ph10 |
836 |
bits=16; echo "---- Testing 16-bit library ----"; echo "";; |
| 480 |
chpe |
1055 |
-32) if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi |
| 481 |
|
|
bits=32; echo "---- Testing 32-bit library ----"; echo "";; |
| 482 |
ph10 |
836 |
*) bits=8; echo "---- Testing 8-bit library ----"; echo "";; |
| 483 |
ph10 |
842 |
esac |
| 484 |
|
|
|
| 485 |
ph10 |
666 |
# Primary test, compatible with JIT and all versions of Perl >= 5.8 |
| 486 |
nigel |
49 |
|
| 487 |
|
|
if [ $do1 = yes ] ; then |
| 488 |
ph10 |
931 |
echo $title1 |
| 489 |
ph10 |
666 |
for opt in "" "-s" $jitopt; do |
| 490 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry |
| 491 |
ph10 |
612 |
if [ $? = 0 ] ; then |
| 492 |
|
|
$cf $testdata/testoutput1 testtry |
| 493 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 494 |
|
|
else exit 1 |
| 495 |
|
|
fi |
| 496 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 497 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 498 |
|
|
else echo " OK" |
| 499 |
ph10 |
666 |
fi |
| 500 |
ph10 |
654 |
done |
| 501 |
nigel |
49 |
fi |
| 502 |
|
|
|
| 503 |
ph10 |
666 |
# PCRE tests that are not JIT or Perl-compatible: API, errors, internals |
| 504 |
nigel |
49 |
|
| 505 |
|
|
if [ $do2 = yes ] ; then |
| 506 |
ph10 |
931 |
echo $title2 "(not UTF-$bits)" |
| 507 |
ph10 |
666 |
for opt in "" "-s" $jitopt; do |
| 508 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry |
| 509 |
ph10 |
612 |
if [ $? = 0 ] ; then |
| 510 |
|
|
$cf $testdata/testoutput2 testtry |
| 511 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 512 |
|
|
else |
| 513 |
|
|
echo " " |
| 514 |
|
|
echo "** Test 2 requires a lot of stack. If it has crashed with a" |
| 515 |
|
|
echo "** segmentation fault, it may be that you do not have enough" |
| 516 |
|
|
echo "** stack available by default. Please see the 'pcrestack' man" |
| 517 |
|
|
echo "** page for a discussion of PCRE's stack usage." |
| 518 |
|
|
echo " " |
| 519 |
|
|
exit 1 |
| 520 |
|
|
fi |
| 521 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 522 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 523 |
|
|
else echo " OK" |
| 524 |
ph10 |
666 |
fi |
| 525 |
ph10 |
654 |
done |
| 526 |
nigel |
49 |
fi |
| 527 |
|
|
|
| 528 |
ph10 |
157 |
# Locale-specific tests, provided that either the "fr_FR" or the "french" |
| 529 |
|
|
# locale is available. The former is the Unix-like standard; the latter is |
| 530 |
ph10 |
706 |
# for Windows. Another possibility is "fr", which needs to be run against |
| 531 |
|
|
# the Windows-specific input and output files. |
| 532 |
nigel |
49 |
|
| 533 |
nigel |
63 |
if [ $do3 = yes ] ; then |
| 534 |
nigel |
73 |
locale -a | grep '^fr_FR$' >/dev/null |
| 535 |
nigel |
49 |
if [ $? -eq 0 ] ; then |
| 536 |
ph10 |
157 |
locale=fr_FR |
| 537 |
|
|
infile=$testdata/testinput3 |
| 538 |
|
|
outfile=$testdata/testoutput3 |
| 539 |
|
|
else |
| 540 |
ph10 |
706 |
infile=test3input |
| 541 |
|
|
outfile=test3output |
| 542 |
ph10 |
157 |
locale -a | grep '^french$' >/dev/null |
| 543 |
|
|
if [ $? -eq 0 ] ; then |
| 544 |
|
|
locale=french |
| 545 |
|
|
sed 's/fr_FR/french/' $testdata/testinput3 >test3input |
| 546 |
|
|
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output |
| 547 |
|
|
else |
| 548 |
ph10 |
706 |
locale -a | grep '^fr$' >/dev/null |
| 549 |
|
|
if [ $? -eq 0 ] ; then |
| 550 |
|
|
locale=fr |
| 551 |
|
|
sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input |
| 552 |
|
|
sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output |
| 553 |
|
|
else |
| 554 |
|
|
locale= |
| 555 |
ph10 |
708 |
fi |
| 556 |
ph10 |
157 |
fi |
| 557 |
ph10 |
159 |
fi |
| 558 |
ph10 |
157 |
|
| 559 |
|
|
if [ "$locale" != "" ] ; then |
| 560 |
ph10 |
931 |
echo $title3 "(using '$locale' locale)" |
| 561 |
ph10 |
666 |
for opt in "" "-s" $jitopt; do |
| 562 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $infile testtry |
| 563 |
ph10 |
612 |
if [ $? = 0 ] ; then |
| 564 |
|
|
$cf $outfile testtry |
| 565 |
|
|
if [ $? != 0 ] ; then |
| 566 |
|
|
echo " " |
| 567 |
|
|
echo "Locale test did not run entirely successfully." |
| 568 |
|
|
echo "This usually means that there is a problem with the locale" |
| 569 |
|
|
echo "settings rather than a bug in PCRE." |
| 570 |
ph10 |
654 |
break; |
| 571 |
ph10 |
612 |
else |
| 572 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 573 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 574 |
|
|
else echo " OK" |
| 575 |
ph10 |
666 |
fi |
| 576 |
ph10 |
612 |
fi |
| 577 |
|
|
else exit 1 |
| 578 |
nigel |
77 |
fi |
| 579 |
ph10 |
654 |
done |
| 580 |
nigel |
49 |
else |
| 581 |
ph10 |
712 |
echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or" |
| 582 |
|
|
echo "'french' locales exist, or the \"locale\" command is not available" |
| 583 |
ph10 |
157 |
echo "to check for them." |
| 584 |
nigel |
77 |
echo " " |
| 585 |
nigel |
49 |
fi |
| 586 |
|
|
fi |
| 587 |
|
|
|
| 588 |
ph10 |
836 |
# Additional tests for UTF support |
| 589 |
nigel |
49 |
|
| 590 |
nigel |
63 |
if [ $do4 = yes ] ; then |
| 591 |
ph10 |
931 |
echo ${title4A}-${bits}${title4B} |
| 592 |
ph10 |
836 |
if [ $utf -eq 0 ] ; then |
| 593 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 594 |
ph10 |
674 |
else |
| 595 |
ph10 |
671 |
for opt in "" "-s" $jitopt; do |
| 596 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry |
| 597 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 598 |
|
|
$cf $testdata/testoutput4 testtry |
| 599 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 600 |
|
|
else exit 1 |
| 601 |
|
|
fi |
| 602 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 603 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 604 |
|
|
else echo " OK" |
| 605 |
ph10 |
671 |
fi |
| 606 |
|
|
done |
| 607 |
ph10 |
674 |
fi |
| 608 |
nigel |
49 |
fi |
| 609 |
|
|
|
| 610 |
nigel |
63 |
if [ $do5 = yes ] ; then |
| 611 |
ph10 |
931 |
echo ${title5}-${bits} support |
| 612 |
ph10 |
836 |
if [ $utf -eq 0 ] ; then |
| 613 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 614 |
ph10 |
674 |
else |
| 615 |
ph10 |
671 |
for opt in "" "-s" $jitopt; do |
| 616 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry |
| 617 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 618 |
|
|
$cf $testdata/testoutput5 testtry |
| 619 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 620 |
|
|
else exit 1 |
| 621 |
|
|
fi |
| 622 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 623 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 624 |
|
|
else echo " OK" |
| 625 |
ph10 |
671 |
fi |
| 626 |
|
|
done |
| 627 |
ph10 |
674 |
fi |
| 628 |
nigel |
49 |
fi |
| 629 |
|
|
|
| 630 |
nigel |
75 |
if [ $do6 = yes ] ; then |
| 631 |
ph10 |
931 |
echo $title6 |
| 632 |
ph10 |
836 |
if [ $utf -eq 0 -o $ucp -eq 0 ] ; then |
| 633 |
ph10 |
671 |
echo " Skipped because Unicode property support is not available" |
| 634 |
ph10 |
674 |
else |
| 635 |
ph10 |
671 |
for opt in "" "-s" $jitopt; do |
| 636 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry |
| 637 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 638 |
|
|
$cf $testdata/testoutput6 testtry |
| 639 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 640 |
|
|
else exit 1 |
| 641 |
|
|
fi |
| 642 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 643 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 644 |
|
|
else echo " OK" |
| 645 |
ph10 |
671 |
fi |
| 646 |
|
|
done |
| 647 |
ph10 |
674 |
fi |
| 648 |
nigel |
75 |
fi |
| 649 |
|
|
|
| 650 |
ph10 |
836 |
# Test non-Perl-compatible Unicode property support |
| 651 |
|
|
|
| 652 |
|
|
if [ $do7 = yes ] ; then |
| 653 |
ph10 |
931 |
echo $title7 |
| 654 |
ph10 |
836 |
if [ $utf -eq 0 -o $ucp -eq 0 ] ; then |
| 655 |
|
|
echo " Skipped because Unicode property support is not available" |
| 656 |
|
|
else |
| 657 |
|
|
for opt in "" "-s" $jitopt; do |
| 658 |
|
|
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry |
| 659 |
|
|
if [ $? = 0 ] ; then |
| 660 |
|
|
$cf $testdata/testoutput7 testtry |
| 661 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 662 |
|
|
else exit 1 |
| 663 |
|
|
fi |
| 664 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 665 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 666 |
|
|
else echo " OK" |
| 667 |
|
|
fi |
| 668 |
|
|
done |
| 669 |
|
|
fi |
| 670 |
|
|
fi |
| 671 |
|
|
|
| 672 |
nigel |
77 |
# Tests for DFA matching support |
| 673 |
|
|
|
| 674 |
ph10 |
836 |
if [ $do8 = yes ] ; then |
| 675 |
ph10 |
931 |
echo $title8 |
| 676 |
ph10 |
654 |
for opt in "" "-s"; do |
| 677 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry |
| 678 |
ph10 |
612 |
if [ $? = 0 ] ; then |
| 679 |
ph10 |
836 |
$cf $testdata/testoutput8 testtry |
| 680 |
ph10 |
612 |
if [ $? != 0 ] ; then exit 1; fi |
| 681 |
|
|
else exit 1 |
| 682 |
|
|
fi |
| 683 |
ph10 |
671 |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 684 |
ph10 |
654 |
done |
| 685 |
nigel |
77 |
fi |
| 686 |
|
|
|
| 687 |
ph10 |
836 |
if [ $do9 = yes ] ; then |
| 688 |
ph10 |
931 |
echo ${title9}-${bits} |
| 689 |
ph10 |
836 |
if [ $utf -eq 0 ] ; then |
| 690 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 691 |
ph10 |
674 |
else |
| 692 |
ph10 |
671 |
for opt in "" "-s"; do |
| 693 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry |
| 694 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 695 |
ph10 |
836 |
$cf $testdata/testoutput9 testtry |
| 696 |
ph10 |
671 |
if [ $? != 0 ] ; then exit 1; fi |
| 697 |
|
|
else exit 1 |
| 698 |
|
|
fi |
| 699 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 700 |
|
|
done |
| 701 |
ph10 |
674 |
fi |
| 702 |
nigel |
77 |
fi |
| 703 |
|
|
|
| 704 |
ph10 |
836 |
if [ $do10 = yes ] ; then |
| 705 |
ph10 |
931 |
echo $title10 |
| 706 |
ph10 |
836 |
if [ $utf -eq 0 -o $ucp -eq 0 ] ; then |
| 707 |
ph10 |
671 |
echo " Skipped because Unicode property support is not available" |
| 708 |
ph10 |
674 |
else |
| 709 |
ph10 |
671 |
for opt in "" "-s"; do |
| 710 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry |
| 711 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 712 |
ph10 |
836 |
$cf $testdata/testoutput10 testtry |
| 713 |
ph10 |
671 |
if [ $? != 0 ] ; then exit 1; fi |
| 714 |
|
|
else exit 1 |
| 715 |
|
|
fi |
| 716 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 717 |
|
|
done |
| 718 |
ph10 |
674 |
fi |
| 719 |
nigel |
77 |
fi |
| 720 |
|
|
|
| 721 |
ph10 |
164 |
# Test of internal offsets and code sizes. This test is run only when there |
| 722 |
|
|
# is Unicode property support and the link size is 2. The actual tests are |
| 723 |
|
|
# mostly the same as in some of the above, but in this test we inspect some |
| 724 |
|
|
# offsets and sizes that require a known link size. This is a doublecheck for |
| 725 |
ph10 |
836 |
# the maintainer, just in case something changes unexpectely. The output from |
| 726 |
|
|
# this test is not the same in 8-bit and 16-bit modes. |
| 727 |
ph10 |
164 |
|
| 728 |
ph10 |
836 |
if [ $do11 = yes ] ; then |
| 729 |
ph10 |
931 |
echo $title11 |
| 730 |
ph10 |
674 |
if [ $link_size -ne 2 ] ; then |
| 731 |
ph10 |
671 |
echo " Skipped because link size is not 2" |
| 732 |
ph10 |
674 |
elif [ $ucp -eq 0 ] ; then |
| 733 |
ph10 |
671 |
echo " Skipped because Unicode property support is not available" |
| 734 |
ph10 |
674 |
else |
| 735 |
ph10 |
671 |
for opt in "" "-s"; do |
| 736 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry |
| 737 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 738 |
ph10 |
836 |
$cf $testdata/testoutput11-$bits testtry |
| 739 |
ph10 |
671 |
if [ $? != 0 ] ; then exit 1; fi |
| 740 |
|
|
else exit 1 |
| 741 |
|
|
fi |
| 742 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
| 743 |
|
|
done |
| 744 |
ph10 |
674 |
fi |
| 745 |
ph10 |
164 |
fi |
| 746 |
|
|
|
| 747 |
ph10 |
836 |
# Test JIT-specific features when JIT is available |
| 748 |
ph10 |
448 |
|
| 749 |
ph10 |
836 |
if [ $do12 = yes ] ; then |
| 750 |
ph10 |
931 |
echo $title12 |
| 751 |
ph10 |
1251 |
if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then |
| 752 |
ph10 |
836 |
echo " Skipped because JIT is not available or not usable" |
| 753 |
|
|
else |
| 754 |
|
|
$sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry |
| 755 |
ph10 |
612 |
if [ $? = 0 ] ; then |
| 756 |
ph10 |
836 |
$cf $testdata/testoutput12 testtry |
| 757 |
ph10 |
612 |
if [ $? != 0 ] ; then exit 1; fi |
| 758 |
|
|
else exit 1 |
| 759 |
|
|
fi |
| 760 |
ph10 |
836 |
echo " OK" |
| 761 |
|
|
fi |
| 762 |
|
|
fi |
| 763 |
|
|
|
| 764 |
|
|
# Test JIT-specific features when JIT is not available |
| 765 |
|
|
|
| 766 |
|
|
if [ $do13 = yes ] ; then |
| 767 |
ph10 |
931 |
echo $title13 |
| 768 |
ph10 |
836 |
if [ $jit -ne 0 ] ; then |
| 769 |
|
|
echo " Skipped because JIT is available" |
| 770 |
|
|
else |
| 771 |
|
|
$sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry |
| 772 |
|
|
if [ $? = 0 ] ; then |
| 773 |
|
|
$cf $testdata/testoutput13 testtry |
| 774 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 775 |
|
|
else exit 1 |
| 776 |
ph10 |
666 |
fi |
| 777 |
ph10 |
836 |
echo " OK" |
| 778 |
|
|
fi |
| 779 |
ph10 |
448 |
fi |
| 780 |
|
|
|
| 781 |
ph10 |
836 |
# Tests for 8-bit-specific features |
| 782 |
ph10 |
448 |
|
| 783 |
ph10 |
836 |
if [ "$do14" = yes ] ; then |
| 784 |
ph10 |
931 |
echo $title14 |
| 785 |
chpe |
1055 |
if [ "$bits" = "16" -o "$bits" = "32" ] ; then |
| 786 |
|
|
echo " Skipped when running 16/32-bit tests" |
| 787 |
ph10 |
842 |
else |
| 788 |
|
|
cp -f $testdata/saved16 testsaved16 |
| 789 |
chpe |
1055 |
cp -f $testdata/saved32 testsaved32 |
| 790 |
ph10 |
671 |
for opt in "" "-s" $jitopt; do |
| 791 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry |
| 792 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 793 |
ph10 |
836 |
$cf $testdata/testoutput14 testtry |
| 794 |
ph10 |
671 |
if [ $? != 0 ] ; then exit 1; fi |
| 795 |
|
|
else exit 1 |
| 796 |
|
|
fi |
| 797 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 798 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 799 |
|
|
else echo " OK" |
| 800 |
ph10 |
671 |
fi |
| 801 |
|
|
done |
| 802 |
ph10 |
674 |
fi |
| 803 |
ph10 |
448 |
fi |
| 804 |
|
|
|
| 805 |
ph10 |
836 |
# Tests for 8-bit-specific features (needs UTF-8 support) |
| 806 |
ph10 |
651 |
|
| 807 |
ph10 |
836 |
if [ "$do15" = yes ] ; then |
| 808 |
ph10 |
931 |
echo $title15 |
| 809 |
chpe |
1055 |
if [ "$bits" = "16" -o "$bits" = "32" ] ; then |
| 810 |
|
|
echo " Skipped when running 16/32-bit tests" |
| 811 |
ph10 |
836 |
elif [ $utf -eq 0 ] ; then |
| 812 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 813 |
ph10 |
842 |
else |
| 814 |
ph10 |
836 |
for opt in "" "-s" $jitopt; do |
| 815 |
|
|
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry |
| 816 |
|
|
if [ $? = 0 ] ; then |
| 817 |
|
|
$cf $testdata/testoutput15 testtry |
| 818 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 819 |
|
|
else exit 1 |
| 820 |
|
|
fi |
| 821 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 822 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 823 |
|
|
else echo " OK" |
| 824 |
|
|
fi |
| 825 |
|
|
done |
| 826 |
|
|
fi |
| 827 |
|
|
fi |
| 828 |
|
|
|
| 829 |
|
|
# Tests for 8-bit-specific features (Unicode property support) |
| 830 |
|
|
|
| 831 |
|
|
if [ $do16 = yes ] ; then |
| 832 |
ph10 |
931 |
echo $title16 |
| 833 |
chpe |
1055 |
if [ "$bits" = "16" -o "$bits" = "32" ] ; then |
| 834 |
|
|
echo " Skipped when running 16/32-bit tests" |
| 835 |
ph10 |
836 |
elif [ $ucp -eq 0 ] ; then |
| 836 |
ph10 |
671 |
echo " Skipped because Unicode property support is not available" |
| 837 |
ph10 |
842 |
else |
| 838 |
ph10 |
671 |
for opt in "" "-s" $jitopt; do |
| 839 |
ph10 |
836 |
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry |
| 840 |
ph10 |
671 |
if [ $? = 0 ] ; then |
| 841 |
ph10 |
836 |
$cf $testdata/testoutput16 testtry |
| 842 |
ph10 |
671 |
if [ $? != 0 ] ; then exit 1; fi |
| 843 |
|
|
else exit 1 |
| 844 |
|
|
fi |
| 845 |
ph10 |
674 |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 846 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 847 |
|
|
else echo " OK" |
| 848 |
ph10 |
671 |
fi |
| 849 |
|
|
done |
| 850 |
ph10 |
674 |
fi |
| 851 |
ph10 |
671 |
fi |
| 852 |
|
|
|
| 853 |
chpe |
1055 |
# Tests for 16/32-bit-specific features |
| 854 |
ph10 |
671 |
|
| 855 |
ph10 |
836 |
if [ $do17 = yes ] ; then |
| 856 |
ph10 |
931 |
echo $title17 |
| 857 |
ph10 |
836 |
if [ "$bits" = "8" ] ; then |
| 858 |
|
|
echo " Skipped when running 8-bit tests" |
| 859 |
ph10 |
842 |
else |
| 860 |
ph10 |
836 |
for opt in "" "-s" $jitopt; do |
| 861 |
|
|
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry |
| 862 |
|
|
if [ $? = 0 ] ; then |
| 863 |
|
|
$cf $testdata/testoutput17 testtry |
| 864 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 865 |
|
|
else exit 1 |
| 866 |
|
|
fi |
| 867 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 868 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 869 |
|
|
else echo " OK" |
| 870 |
|
|
fi |
| 871 |
|
|
done |
| 872 |
ph10 |
674 |
fi |
| 873 |
ph10 |
671 |
fi |
| 874 |
ph10 |
674 |
|
| 875 |
chpe |
1055 |
# Tests for 16/32-bit-specific features (UTF-16/32 support) |
| 876 |
ph10 |
671 |
|
| 877 |
ph10 |
836 |
if [ $do18 = yes ] ; then |
| 878 |
ph10 |
931 |
echo $title18 |
| 879 |
ph10 |
836 |
if [ "$bits" = "8" ] ; then |
| 880 |
|
|
echo " Skipped when running 8-bit tests" |
| 881 |
|
|
elif [ $utf -eq 0 ] ; then |
| 882 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 883 |
ph10 |
842 |
else |
| 884 |
ph10 |
836 |
for opt in "" "-s" $jitopt; do |
| 885 |
|
|
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry |
| 886 |
|
|
if [ $? = 0 ] ; then |
| 887 |
chpe |
1055 |
$cf $testdata/testoutput18-$bits testtry |
| 888 |
ph10 |
836 |
if [ $? != 0 ] ; then exit 1; fi |
| 889 |
|
|
else exit 1 |
| 890 |
|
|
fi |
| 891 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 892 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 893 |
|
|
else echo " OK" |
| 894 |
|
|
fi |
| 895 |
|
|
done |
| 896 |
ph10 |
674 |
fi |
| 897 |
ph10 |
651 |
fi |
| 898 |
|
|
|
| 899 |
chpe |
1055 |
# Tests for 16/32-bit-specific features (Unicode property support) |
| 900 |
ph10 |
836 |
|
| 901 |
|
|
if [ $do19 = yes ] ; then |
| 902 |
ph10 |
931 |
echo $title19 |
| 903 |
ph10 |
836 |
if [ "$bits" = "8" ] ; then |
| 904 |
|
|
echo " Skipped when running 8-bit tests" |
| 905 |
|
|
elif [ $ucp -eq 0 ] ; then |
| 906 |
|
|
echo " Skipped because Unicode property support is not available" |
| 907 |
ph10 |
842 |
else |
| 908 |
ph10 |
836 |
for opt in "" "-s" $jitopt; do |
| 909 |
|
|
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry |
| 910 |
|
|
if [ $? = 0 ] ; then |
| 911 |
|
|
$cf $testdata/testoutput19 testtry |
| 912 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 913 |
|
|
else exit 1 |
| 914 |
|
|
fi |
| 915 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 916 |
|
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
| 917 |
|
|
else echo " OK" |
| 918 |
|
|
fi |
| 919 |
|
|
done |
| 920 |
|
|
fi |
| 921 |
|
|
fi |
| 922 |
|
|
|
| 923 |
ph10 |
1212 |
# Tests for 16/32-bit-specific features in DFA non-UTF-16/32 mode |
| 924 |
ph10 |
836 |
|
| 925 |
|
|
if [ $do20 = yes ] ; then |
| 926 |
ph10 |
931 |
echo $title20 |
| 927 |
ph10 |
836 |
if [ "$bits" = "8" ] ; then |
| 928 |
|
|
echo " Skipped when running 8-bit tests" |
| 929 |
ph10 |
842 |
else |
| 930 |
ph10 |
836 |
for opt in "" "-s"; do |
| 931 |
ph10 |
1212 |
$sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput20 testtry |
| 932 |
ph10 |
836 |
if [ $? = 0 ] ; then |
| 933 |
|
|
$cf $testdata/testoutput20 testtry |
| 934 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 935 |
|
|
else exit 1 |
| 936 |
|
|
fi |
| 937 |
|
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
| 938 |
|
|
else echo " OK" |
| 939 |
|
|
fi |
| 940 |
|
|
done |
| 941 |
|
|
fi |
| 942 |
|
|
fi |
| 943 |
|
|
|
| 944 |
chpe |
1055 |
# Tests for reloads with 16/32-bit library |
| 945 |
ph10 |
897 |
|
| 946 |
|
|
if [ $do21 = yes ] ; then |
| 947 |
ph10 |
931 |
echo $title21 |
| 948 |
ph10 |
897 |
if [ "$bits" = "8" ] ; then |
| 949 |
|
|
echo " Skipped when running 8-bit tests" |
| 950 |
|
|
elif [ $link_size -ne 2 ] ; then |
| 951 |
|
|
echo " Skipped because link size is not 2" |
| 952 |
|
|
else |
| 953 |
|
|
cp -f $testdata/saved8 testsaved8 |
| 954 |
|
|
cp -f $testdata/saved16LE-1 testsaved16LE-1 |
| 955 |
|
|
cp -f $testdata/saved16BE-1 testsaved16BE-1 |
| 956 |
chpe |
1055 |
cp -f $testdata/saved32LE-1 testsaved32LE-1 |
| 957 |
|
|
cp -f $testdata/saved32BE-1 testsaved32BE-1 |
| 958 |
ph10 |
897 |
$sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry |
| 959 |
|
|
if [ $? = 0 ] ; then |
| 960 |
chpe |
1055 |
$cf $testdata/testoutput21-$bits testtry |
| 961 |
ph10 |
897 |
if [ $? != 0 ] ; then exit 1; fi |
| 962 |
|
|
else exit 1 |
| 963 |
|
|
fi |
| 964 |
|
|
echo " OK" |
| 965 |
|
|
fi |
| 966 |
|
|
fi |
| 967 |
|
|
|
| 968 |
chpe |
1055 |
# Tests for reloads with 16/32-bit library (UTF-16 support) |
| 969 |
ph10 |
897 |
|
| 970 |
|
|
if [ $do22 = yes ] ; then |
| 971 |
ph10 |
931 |
echo $title22 |
| 972 |
ph10 |
897 |
if [ "$bits" = "8" ] ; then |
| 973 |
|
|
echo " Skipped when running 8-bit tests" |
| 974 |
|
|
elif [ $utf -eq 0 ] ; then |
| 975 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 976 |
|
|
elif [ $link_size -ne 2 ] ; then |
| 977 |
|
|
echo " Skipped because link size is not 2" |
| 978 |
|
|
else |
| 979 |
|
|
cp -f $testdata/saved16LE-2 testsaved16LE-2 |
| 980 |
|
|
cp -f $testdata/saved16BE-2 testsaved16BE-2 |
| 981 |
chpe |
1055 |
cp -f $testdata/saved32LE-2 testsaved32LE-2 |
| 982 |
|
|
cp -f $testdata/saved32BE-2 testsaved32BE-2 |
| 983 |
ph10 |
897 |
$sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry |
| 984 |
|
|
if [ $? = 0 ] ; then |
| 985 |
chpe |
1055 |
$cf $testdata/testoutput22-$bits testtry |
| 986 |
ph10 |
897 |
if [ $? != 0 ] ; then exit 1; fi |
| 987 |
|
|
else exit 1 |
| 988 |
|
|
fi |
| 989 |
|
|
echo " OK" |
| 990 |
|
|
fi |
| 991 |
|
|
fi |
| 992 |
|
|
|
| 993 |
chpe |
1055 |
if [ $do23 = yes ] ; then |
| 994 |
|
|
echo $title23 |
| 995 |
|
|
if [ "$bits" = "8" -o "$bits" = "32" ] ; then |
| 996 |
|
|
echo " Skipped when running 8/32-bit tests" |
| 997 |
|
|
else |
| 998 |
|
|
$sim $valgrind ./pcretest -q $bmode $testdata/testinput23 testtry |
| 999 |
|
|
if [ $? = 0 ] ; then |
| 1000 |
|
|
$cf $testdata/testoutput23 testtry |
| 1001 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 1002 |
|
|
else exit 1 |
| 1003 |
|
|
fi |
| 1004 |
|
|
echo " OK" |
| 1005 |
|
|
fi |
| 1006 |
|
|
fi |
| 1007 |
|
|
|
| 1008 |
|
|
if [ $do24 = yes ] ; then |
| 1009 |
|
|
echo $title24 |
| 1010 |
|
|
if [ "$bits" = "8" -o "$bits" = "32" ] ; then |
| 1011 |
|
|
echo " Skipped when running 8/32-bit tests" |
| 1012 |
|
|
elif [ $utf -eq 0 ] ; then |
| 1013 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 1014 |
|
|
else |
| 1015 |
|
|
$sim $valgrind ./pcretest -q $bmode $testdata/testinput24 testtry |
| 1016 |
|
|
if [ $? = 0 ] ; then |
| 1017 |
|
|
$cf $testdata/testoutput24 testtry |
| 1018 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 1019 |
|
|
else exit 1 |
| 1020 |
|
|
fi |
| 1021 |
|
|
echo " OK" |
| 1022 |
|
|
fi |
| 1023 |
|
|
fi |
| 1024 |
|
|
|
| 1025 |
|
|
if [ $do25 = yes ] ; then |
| 1026 |
|
|
echo $title25 |
| 1027 |
|
|
if [ "$bits" = "8" -o "$bits" = "16" ] ; then |
| 1028 |
|
|
echo " Skipped when running 8/16-bit tests" |
| 1029 |
|
|
else |
| 1030 |
|
|
$sim $valgrind ./pcretest -q $bmode $testdata/testinput25 testtry |
| 1031 |
|
|
if [ $? = 0 ] ; then |
| 1032 |
|
|
$cf $testdata/testoutput25 testtry |
| 1033 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 1034 |
|
|
else exit 1 |
| 1035 |
|
|
fi |
| 1036 |
|
|
echo " OK" |
| 1037 |
|
|
fi |
| 1038 |
|
|
fi |
| 1039 |
|
|
|
| 1040 |
|
|
if [ $do26 = yes ] ; then |
| 1041 |
|
|
echo $title26 |
| 1042 |
|
|
if [ "$bits" = "8" -o "$bits" = "16" ] ; then |
| 1043 |
|
|
echo " Skipped when running 8/16-bit tests" |
| 1044 |
|
|
elif [ $utf -eq 0 ] ; then |
| 1045 |
|
|
echo " Skipped because UTF-$bits support is not available" |
| 1046 |
|
|
else |
| 1047 |
|
|
$sim $valgrind ./pcretest -q $bmode $testdata/testinput26 testtry |
| 1048 |
|
|
if [ $? = 0 ] ; then |
| 1049 |
|
|
$cf $testdata/testoutput26 testtry |
| 1050 |
|
|
if [ $? != 0 ] ; then exit 1; fi |
| 1051 |
|
|
else exit 1 |
| 1052 |
|
|
fi |
| 1053 |
|
|
echo " OK" |
| 1054 |
|
|
fi |
| 1055 |
|
|
fi |
| 1056 |
|
|
|
| 1057 |
|
|
# End of loop for 8/16/32-bit tests |
| 1058 |
ph10 |
836 |
done |
| 1059 |
|
|
|
| 1060 |
ph10 |
842 |
# Clean up local working files |
| 1061 |
|
|
rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry |
| 1062 |
|
|
|
| 1063 |
nigel |
49 |
# End |