1 |
#! /bin/sh |
#! /bin/sh |
2 |
|
|
3 |
# Run PCRE tests |
# Run the PCRE tests using the pcretest program. The appropriate tests are |
4 |
|
# selected, depending on which build-time options were used. |
5 |
|
|
6 |
cf="diff -u" |
# All tests are now run both with and without -s, to ensure that everything is |
7 |
valgrind= |
# tested with and without studying. However, there are some tests that produce |
8 |
testdata=testdata |
# different output after studying, typically when we are tracing the actual |
9 |
|
# matching process (for example, using auto-callouts). In these few cases, the |
10 |
if [ -n "$srcdir" -a -d "$srcdir" ] ; then |
# tests are duplicated in the files, one with /S to force studying always, and |
11 |
testdata="$srcdir/testdata" |
# one with /SS to force *not* studying always. The use of -s doesn't then make |
12 |
fi |
# any difference to their output. There is also one test which compiles invalid |
13 |
|
# UTF-8 with the UTF-8 check turned off; for this, studying must also be |
14 |
# Find which optional facilities are available |
# disabled with /SS. |
15 |
|
|
16 |
|
# When JIT support is available, all the tests are also run with -s+ to test |
17 |
|
# (again, almost) everything with studying and the JIT option. There are also |
18 |
|
# two tests for JIT-specific features, one to be run when JIT support is |
19 |
|
# available, and one when it is not. |
20 |
|
|
21 |
|
# The arguments for this script can be individual test numbers, or the word |
22 |
|
# "valgrind", or "sim" followed by an argument to run cross-compiled |
23 |
|
# executables under a simulator, for example: |
24 |
|
# |
25 |
|
# RunTest 3 sim "qemu-arm -s 8388608" |
26 |
|
|
27 |
case `./pcretest -C | ./pcregrep 'Internal link size'` in |
valgrind= |
28 |
*2) link_size=2;; |
sim= |
|
*3) link_size=3;; |
|
|
*4) link_size=4;; |
|
|
*) echo "Failed to find internal link size"; exit 1;; |
|
|
esac |
|
|
|
|
|
./pcretest -C | ./pcregrep 'No UTF-8 support' >/dev/null |
|
|
utf8=$? |
|
|
|
|
|
./pcretest -C | ./pcregrep 'No Unicode properties support' >/dev/null |
|
|
ucp=$? |
|
29 |
|
|
30 |
# Select which tests to run; for those that are explicitly requested, check |
# Select which tests to run; for those that are explicitly requested, check |
31 |
# that the necessary optional facilities are available. |
# that the necessary optional facilities are available. |
39 |
do7=no |
do7=no |
40 |
do8=no |
do8=no |
41 |
do9=no |
do9=no |
42 |
|
do10=no |
43 |
|
do11=no |
44 |
|
do12=no |
45 |
|
do13=no |
46 |
|
do14=no |
47 |
|
do15=no |
48 |
|
|
49 |
while [ $# -gt 0 ] ; do |
while [ $# -gt 0 ] ; do |
50 |
case $1 in |
case $1 in |
57 |
7) do7=yes;; |
7) do7=yes;; |
58 |
8) do8=yes;; |
8) do8=yes;; |
59 |
9) do9=yes;; |
9) do9=yes;; |
60 |
valgrind) valgrind="valgrind -q";; |
10) do10=yes;; |
61 |
|
11) do11=yes;; |
62 |
|
12) do12=yes;; |
63 |
|
13) do13=yes;; |
64 |
|
14) do14=yes;; |
65 |
|
15) do15=yes;; |
66 |
|
valgrind) valgrind="valgrind -q --smc-check=all";; |
67 |
|
sim) shift; sim=$1;; |
68 |
*) echo "Unknown test number $1"; exit 1;; |
*) echo "Unknown test number $1"; exit 1;; |
69 |
esac |
esac |
70 |
shift |
shift |
71 |
done |
done |
72 |
|
|
73 |
if [ "$link_size" != "2" ] ; then |
# Set up a suitable "diff" command for comparison. Some systems |
74 |
if [ $do2 = yes ] ; then |
# have a diff that lacks a -u option. Try to deal with this. |
75 |
echo "Can't run test 2 with an internal link size other than 2" |
|
76 |
exit 1 |
if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi |
77 |
fi |
|
78 |
if [ $do5 = yes ] ; then |
# Find the test data |
79 |
echo "Can't run test 5 with an internal link size other than 2" |
|
80 |
exit 1 |
testdata=testdata |
81 |
fi |
if [ -n "$srcdir" -a -d "$srcdir" ] ; then |
82 |
if [ $do6 = yes ] ; then |
testdata="$srcdir/testdata" |
83 |
echo "Can't run test 6 with an internal link size other than 2" |
fi |
84 |
exit 1 |
|
85 |
fi |
# Find which optional facilities are available |
86 |
|
|
87 |
|
case `$sim ./pcretest -C | $sim ./pcregrep 'Internal link size'` in |
88 |
|
*2) link_size=2;; |
89 |
|
*3) link_size=3;; |
90 |
|
*4) link_size=4;; |
91 |
|
*) echo "Failed to find internal link size"; exit 1;; |
92 |
|
esac |
93 |
|
|
94 |
|
$sim ./pcretest -C | $sim ./pcregrep 'No UTF-8 support' >/dev/null |
95 |
|
utf8=$? |
96 |
|
|
97 |
|
$sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null |
98 |
|
ucp=$? |
99 |
|
|
100 |
|
jitopt= |
101 |
|
$sim ./pcretest -C | $sim ./pcregrep 'No just-in-time compiler support' \ |
102 |
|
>/dev/null |
103 |
|
jit=$? |
104 |
|
if [ $jit -ne 0 ] ; then |
105 |
|
jitopt=-s+ |
106 |
fi |
fi |
107 |
|
|
108 |
if [ $utf8 -eq 0 ] ; then |
if [ $utf8 -eq 0 ] ; then |
114 |
echo "Can't run test 5 because UTF-8 support is not configured" |
echo "Can't run test 5 because UTF-8 support is not configured" |
115 |
exit 1 |
exit 1 |
116 |
fi |
fi |
|
if [ $do6 = yes ] ; then |
|
|
echo "Can't run test 6 because UTF-8 support is not configured" |
|
|
exit 1 |
|
|
fi |
|
117 |
if [ $do8 = yes ] ; then |
if [ $do8 = yes ] ; then |
118 |
echo "Can't run test 8 because UTF-8 support is not configured" |
echo "Can't run test 8 because UTF-8 support is not configured" |
119 |
exit 1 |
exit 1 |
120 |
fi |
fi |
121 |
if [ $do9 = yes ] ; then |
if [ $do12 = yes ] ; then |
122 |
echo "Can't run test 9 because UTF-8 support is not configured" |
echo "Can't run test 12 because UTF-8 support is not configured" |
123 |
exit 1 |
exit 1 |
124 |
fi |
fi |
125 |
fi |
fi |
133 |
echo "Can't run test 9 because Unicode property support is not configured" |
echo "Can't run test 9 because Unicode property support is not configured" |
134 |
exit 1 |
exit 1 |
135 |
fi |
fi |
136 |
|
if [ $do10 = yes ] ; then |
137 |
|
echo "Can't run test 10 because Unicode property support is not configured" |
138 |
|
exit 1 |
139 |
|
fi |
140 |
|
if [ $do13 = yes ] ; then |
141 |
|
echo "Can't run test 12 because Unicode property support is not configured" |
142 |
|
exit 1 |
143 |
|
fi |
144 |
|
fi |
145 |
|
|
146 |
|
if [ $link_size -ne 2 ] ; then |
147 |
|
if [ $do10 = yes ] ; then |
148 |
|
echo "Can't run test 10 because the link size ($link_size) is not 2" |
149 |
|
exit 1 |
150 |
|
fi |
151 |
|
fi |
152 |
|
|
153 |
|
if [ $jit -eq 0 ] ; then |
154 |
|
if [ $do14 = "yes" ] ; then |
155 |
|
echo "Can't run test 14 because JIT support is not configured" |
156 |
|
exit 1 |
157 |
|
fi |
158 |
|
else |
159 |
|
if [ $do15 = "yes" ] ; then |
160 |
|
echo "Can't run test 15 because JIT support is configured" |
161 |
|
exit 1 |
162 |
|
fi |
163 |
fi |
fi |
164 |
|
|
165 |
# If no specific tests were requested, select all that are relevant. |
# If no specific tests were requested, select all. Those that are not |
166 |
|
# relevant will be skipped. |
167 |
|
|
168 |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \ |
169 |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
170 |
$do9 = no ] ; then |
$do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \ |
171 |
|
$do13 = no -a $do14 = no -a $do15 = no ] ; then |
172 |
do1=yes |
do1=yes |
173 |
do2=yes |
do2=yes |
174 |
do3=yes |
do3=yes |
175 |
if [ $utf8 -ne 0 ] ; then do4=yes; fi |
do4=yes |
176 |
if [ $utf8 -ne 0 ] ; then do5=yes; fi |
do5=yes |
177 |
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do6=yes; fi |
do6=yes |
178 |
do7=yes |
do7=yes |
179 |
if [ $utf8 -ne 0 ] ; then do8=yes; fi |
do8=yes |
180 |
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi |
do9=yes |
181 |
|
do10=yes |
182 |
|
do11=yes |
183 |
|
do12=yes |
184 |
|
do13=yes |
185 |
|
do14=yes |
186 |
|
do15=yes |
187 |
fi |
fi |
188 |
|
|
189 |
# Show which release |
# Show which release |
192 |
echo PCRE C library tests |
echo PCRE C library tests |
193 |
./pcretest /dev/null |
./pcretest /dev/null |
194 |
|
|
195 |
# Primary test, Perl-compatible |
# Primary test, compatible with JIT and all versions of Perl >= 5.8 |
196 |
|
|
197 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
198 |
echo "Test 1: main functionality (Perl compatible)" |
echo "Test 1: main functionality (Compatible with Perl >= 5.8)" |
199 |
$valgrind ./pcretest -q $testdata/testinput1 testtry |
for opt in "" "-s" $jitopt; do |
200 |
if [ $? = 0 ] ; then |
$sim $valgrind ./pcretest -q $opt $testdata/testinput1 testtry |
201 |
$cf testtry $testdata/testoutput1 |
if [ $? = 0 ] ; then |
202 |
if [ $? != 0 ] ; then exit 1; fi |
$cf $testdata/testoutput1 testtry |
203 |
else exit 1 |
if [ $? != 0 ] ; then exit 1; fi |
204 |
fi |
else exit 1 |
205 |
echo "OK" |
fi |
206 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
207 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
208 |
|
else echo " OK" |
209 |
|
fi |
210 |
|
done |
211 |
fi |
fi |
212 |
|
|
213 |
# PCRE tests that are not Perl-compatible - API & error tests, mostly |
# PCRE tests that are not JIT or Perl-compatible: API, errors, internals |
214 |
|
|
215 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
216 |
if [ "$link_size" = "2" ] ; then |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
217 |
echo "Test 2: API and error handling (not Perl compatible)" |
for opt in "" "-s" $jitopt; do |
218 |
$valgrind ./pcretest -q $testdata/testinput2 testtry |
$sim $valgrind ./pcretest -q $opt $testdata/testinput2 testtry |
219 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
220 |
$cf testtry $testdata/testoutput2 |
$cf $testdata/testoutput2 testtry |
221 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
222 |
else exit 1 |
else |
223 |
|
echo " " |
224 |
|
echo "** Test 2 requires a lot of stack. If it has crashed with a" |
225 |
|
echo "** segmentation fault, it may be that you do not have enough" |
226 |
|
echo "** stack available by default. Please see the 'pcrestack' man" |
227 |
|
echo "** page for a discussion of PCRE's stack usage." |
228 |
|
echo " " |
229 |
|
exit 1 |
230 |
fi |
fi |
231 |
echo "OK" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
232 |
else |
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
233 |
echo Test 2 skipped for link size other than 2 \($link_size\) |
else echo " OK" |
234 |
echo " " |
fi |
235 |
fi |
done |
236 |
fi |
fi |
237 |
|
|
238 |
# Locale-specific tests, provided the "fr_FR" locale is available. |
# Locale-specific tests, provided that either the "fr_FR" or the "french" |
239 |
# TODO: Try the locale name "french" instead - as used on Windows - but |
# locale is available. The former is the Unix-like standard; the latter is |
240 |
# this will mean modifying the input and output data. |
# for Windows. |
241 |
|
|
242 |
if [ $do3 = yes ] ; then |
if [ $do3 = yes ] ; then |
243 |
locale -a | grep '^fr_FR$' >/dev/null |
locale -a | grep '^fr_FR$' >/dev/null |
244 |
if [ $? -eq 0 ] ; then |
if [ $? -eq 0 ] ; then |
245 |
echo "Test 3: locale-specific features (using 'fr_FR' locale)" |
locale=fr_FR |
246 |
$valgrind ./pcretest -q $testdata/testinput3 testtry |
infile=$testdata/testinput3 |
247 |
if [ $? = 0 ] ; then |
outfile=$testdata/testoutput3 |
248 |
$cf testtry $testdata/testoutput3 |
else |
249 |
if [ $? != 0 ] ; then |
locale -a | grep '^french$' >/dev/null |
250 |
echo " " |
if [ $? -eq 0 ] ; then |
251 |
echo "Locale test did not run entirely successfully." |
locale=french |
252 |
echo "This usually means that there is a problem with the locale" |
sed 's/fr_FR/french/' $testdata/testinput3 >test3input |
253 |
echo "settings rather than a bug in PCRE." |
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output |
254 |
else |
infile=test3input |
255 |
echo "OK" |
outfile=test3output |
256 |
fi |
else |
257 |
else exit 1 |
locale= |
258 |
fi |
fi |
259 |
|
fi |
260 |
|
|
261 |
|
if [ "$locale" != "" ] ; then |
262 |
|
echo "Test 3: locale-specific features (using '$locale' locale)" |
263 |
|
for opt in "" "-s" $jitopt; do |
264 |
|
$sim $valgrind ./pcretest -q $opt $infile testtry |
265 |
|
if [ $? = 0 ] ; then |
266 |
|
$cf $outfile testtry |
267 |
|
if [ $? != 0 ] ; then |
268 |
|
echo " " |
269 |
|
echo "Locale test did not run entirely successfully." |
270 |
|
echo "This usually means that there is a problem with the locale" |
271 |
|
echo "settings rather than a bug in PCRE." |
272 |
|
break; |
273 |
|
else |
274 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
275 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
276 |
|
else echo " OK" |
277 |
|
fi |
278 |
|
fi |
279 |
|
else exit 1 |
280 |
|
fi |
281 |
|
done |
282 |
else |
else |
283 |
echo "Cannot test locale-specific features - 'fr_FR' locale not found," |
echo "Cannot test locale-specific features - neither the 'fr_FR' nor the" |
284 |
echo "or the \"locale\" command is not available to check for it." |
echo "'french' locale exists, or the \"locale\" command is not available" |
285 |
|
echo "to check for them." |
286 |
echo " " |
echo " " |
287 |
fi |
fi |
288 |
fi |
fi |
290 |
# Additional tests for UTF8 support |
# Additional tests for UTF8 support |
291 |
|
|
292 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
293 |
echo "Test 4: UTF-8 support (Perl compatible)" |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
294 |
$valgrind ./pcretest -q $testdata/testinput4 testtry |
if [ $utf8 -eq 0 ] ; then |
295 |
if [ $? = 0 ] ; then |
echo " Skipped because UTF-8 support is not available" |
296 |
$cf testtry $testdata/testoutput4 |
else |
297 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s" $jitopt; do |
298 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
299 |
|
if [ $? = 0 ] ; then |
300 |
|
$cf $testdata/testoutput4 testtry |
301 |
|
if [ $? != 0 ] ; then exit 1; fi |
302 |
|
else exit 1 |
303 |
|
fi |
304 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
305 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
306 |
|
else echo " OK" |
307 |
|
fi |
308 |
|
done |
309 |
fi |
fi |
|
echo "OK" |
|
310 |
fi |
fi |
311 |
|
|
312 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
313 |
if [ "$link_size" = "2" ] ; then |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
314 |
echo "Test 5: API and internals for UTF-8 support (not Perl compatible)" |
if [ $utf8 -eq 0 ] ; then |
315 |
$valgrind ./pcretest -q $testdata/testinput5 testtry |
echo " Skipped because UTF-8 support is not available" |
316 |
|
else |
317 |
|
for opt in "" "-s" $jitopt; do |
318 |
|
$sim $valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
319 |
|
if [ $? = 0 ] ; then |
320 |
|
$cf $testdata/testoutput5 testtry |
321 |
|
if [ $? != 0 ] ; then exit 1; fi |
322 |
|
else exit 1 |
323 |
|
fi |
324 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
325 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
326 |
|
else echo " OK" |
327 |
|
fi |
328 |
|
done |
329 |
|
fi |
330 |
|
fi |
331 |
|
|
332 |
|
if [ $do6 = yes ] ; then |
333 |
|
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
334 |
|
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
335 |
|
echo " Skipped because Unicode property support is not available" |
336 |
|
else |
337 |
|
for opt in "" "-s" $jitopt; do |
338 |
|
$sim $valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
339 |
|
if [ $? = 0 ] ; then |
340 |
|
$cf $testdata/testoutput6 testtry |
341 |
|
if [ $? != 0 ] ; then exit 1; fi |
342 |
|
else exit 1 |
343 |
|
fi |
344 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
345 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
346 |
|
else echo " OK" |
347 |
|
fi |
348 |
|
done |
349 |
|
fi |
350 |
|
fi |
351 |
|
|
352 |
|
# Tests for DFA matching support |
353 |
|
|
354 |
|
if [ $do7 = yes ] ; then |
355 |
|
echo "Test 7: DFA matching" |
356 |
|
for opt in "" "-s"; do |
357 |
|
$sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry |
358 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
359 |
$cf testtry $testdata/testoutput5 |
$cf $testdata/testoutput7 testtry |
360 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
361 |
else exit 1 |
else exit 1 |
362 |
fi |
fi |
363 |
echo "OK" |
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
364 |
|
done |
365 |
|
fi |
366 |
|
|
367 |
|
if [ $do8 = yes ] ; then |
368 |
|
echo "Test 8: DFA matching with UTF-8" |
369 |
|
if [ $utf8 -eq 0 ] ; then |
370 |
|
echo " Skipped because UTF-8 support is not available" |
371 |
else |
else |
372 |
echo Test 5 skipped for link size other than 2 \($link_size\) |
for opt in "" "-s"; do |
373 |
echo " " |
$sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry |
374 |
|
if [ $? = 0 ] ; then |
375 |
|
$cf $testdata/testoutput8 testtry |
376 |
|
if [ $? != 0 ] ; then exit 1; fi |
377 |
|
else exit 1 |
378 |
|
fi |
379 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
380 |
|
done |
381 |
fi |
fi |
382 |
fi |
fi |
383 |
|
|
384 |
if [ $do6 = yes ] ; then |
if [ $do9 = yes ] ; then |
385 |
if [ "$link_size" = "2" ] ; then |
echo "Test 9: DFA matching with Unicode properties" |
386 |
echo "Test 6: Unicode property support" |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
387 |
$valgrind ./pcretest -q $testdata/testinput6 testtry |
echo " Skipped because Unicode property support is not available" |
388 |
|
else |
389 |
|
for opt in "" "-s"; do |
390 |
|
$sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry |
391 |
|
if [ $? = 0 ] ; then |
392 |
|
$cf $testdata/testoutput9 testtry |
393 |
|
if [ $? != 0 ] ; then exit 1; fi |
394 |
|
else exit 1 |
395 |
|
fi |
396 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
397 |
|
done |
398 |
|
fi |
399 |
|
fi |
400 |
|
|
401 |
|
# Test of internal offsets and code sizes. This test is run only when there |
402 |
|
# is Unicode property support and the link size is 2. The actual tests are |
403 |
|
# mostly the same as in some of the above, but in this test we inspect some |
404 |
|
# offsets and sizes that require a known link size. This is a doublecheck for |
405 |
|
# the maintainer, just in case something changes unexpectely. |
406 |
|
|
407 |
|
if [ $do10 = yes ] ; then |
408 |
|
echo "Test 10: Internal offsets and code size tests" |
409 |
|
if [ $link_size -ne 2 ] ; then |
410 |
|
echo " Skipped because link size is not 2" |
411 |
|
elif [ $ucp -eq 0 ] ; then |
412 |
|
echo " Skipped because Unicode property support is not available" |
413 |
|
else |
414 |
|
for opt in "" "-s"; do |
415 |
|
$sim $valgrind ./pcretest -q $opt $testdata/testinput10 testtry |
416 |
|
if [ $? = 0 ] ; then |
417 |
|
$cf $testdata/testoutput10 testtry |
418 |
|
if [ $? != 0 ] ; then exit 1; fi |
419 |
|
else exit 1 |
420 |
|
fi |
421 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
422 |
|
done |
423 |
|
fi |
424 |
|
fi |
425 |
|
|
426 |
|
# Test of Perl >= 5.10 features without UTF8 support |
427 |
|
|
428 |
|
if [ $do11 = yes ] ; then |
429 |
|
echo "Test 11: Features from Perl >= 5.10 without UTF8 support" |
430 |
|
for opt in "" "-s" $jitopt; do |
431 |
|
$sim $valgrind ./pcretest -q $opt $testdata/testinput11 testtry |
432 |
if [ $? = 0 ] ; then |
if [ $? = 0 ] ; then |
433 |
$cf testtry $testdata/testoutput6 |
$cf $testdata/testoutput11 testtry |
434 |
if [ $? != 0 ] ; then exit 1; fi |
if [ $? != 0 ] ; then exit 1; fi |
435 |
else exit 1 |
else exit 1 |
436 |
fi |
fi |
437 |
echo "OK" |
if [ "$opt" = "-s" ] ; then echo " OK with study" |
438 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
439 |
|
else echo " OK" |
440 |
|
fi |
441 |
|
done |
442 |
|
fi |
443 |
|
|
444 |
|
# Test of Perl >= 5.10 features with UTF8 support |
445 |
|
|
446 |
|
if [ $do12 = yes ] ; then |
447 |
|
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
448 |
|
if [ $utf8 -eq 0 ] ; then |
449 |
|
echo " Skipped because UTF-8 support is not available" |
450 |
else |
else |
451 |
echo Test 6 skipped for link size other than 2 \($link_size\) |
for opt in "" "-s" $jitopt; do |
452 |
echo " " |
$sim $valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
453 |
|
if [ $? = 0 ] ; then |
454 |
|
$cf $testdata/testoutput12 testtry |
455 |
|
if [ $? != 0 ] ; then exit 1; fi |
456 |
|
else exit 1 |
457 |
|
fi |
458 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
459 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
460 |
|
else echo " OK" |
461 |
|
fi |
462 |
|
done |
463 |
fi |
fi |
464 |
fi |
fi |
465 |
|
|
466 |
# Tests for DFA matching support |
# Test non-Perl-compatible Unicode property support |
467 |
|
|
468 |
if [ $do7 = yes ] ; then |
if [ $do13 = yes ] ; then |
469 |
echo "Test 7: DFA matching" |
echo "Test 13: API, internals, and non-Perl stuff for Unicode property support" |
470 |
$valgrind ./pcretest -q -dfa $testdata/testinput7 testtry |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
471 |
if [ $? = 0 ] ; then |
echo " Skipped because Unicode property support is not available" |
472 |
$cf testtry $testdata/testoutput7 |
else |
473 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s" $jitopt; do |
474 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
475 |
|
if [ $? = 0 ] ; then |
476 |
|
$cf $testdata/testoutput13 testtry |
477 |
|
if [ $? != 0 ] ; then exit 1; fi |
478 |
|
else exit 1 |
479 |
|
fi |
480 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
481 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
482 |
|
else echo " OK" |
483 |
|
fi |
484 |
|
done |
485 |
fi |
fi |
|
echo "OK" |
|
486 |
fi |
fi |
487 |
|
|
488 |
if [ $do8 = yes ] ; then |
# Test JIT-specific features when JIT is available |
489 |
echo "Test 8: DFA matching with UTF-8" |
|
490 |
$valgrind ./pcretest -q -dfa $testdata/testinput8 testtry |
if [ $do14 = yes ] ; then |
491 |
if [ $? = 0 ] ; then |
echo "Test 14: JIT-specific features (JIT available)" |
492 |
$cf testtry $testdata/testoutput8 |
if [ $jit -eq 0 ] ; then |
493 |
if [ $? != 0 ] ; then exit 1; fi |
echo " Skipped because JIT is not available or not usable" |
494 |
else exit 1 |
else |
495 |
|
$sim $valgrind ./pcretest -q $testdata/testinput14 testtry |
496 |
|
if [ $? = 0 ] ; then |
497 |
|
$cf $testdata/testoutput14 testtry |
498 |
|
if [ $? != 0 ] ; then exit 1; fi |
499 |
|
else exit 1 |
500 |
|
fi |
501 |
|
echo " OK" |
502 |
fi |
fi |
|
echo "OK" |
|
503 |
fi |
fi |
504 |
|
|
505 |
if [ $do9 = yes ] ; then |
# Test JIT-specific features when JIT is not available |
506 |
echo "Test 9: DFA matching with Unicode properties" |
|
507 |
$valgrind ./pcretest -q -dfa $testdata/testinput9 testtry |
if [ $do15 = yes ] ; then |
508 |
if [ $? = 0 ] ; then |
echo "Test 15: JIT-specific features (JIT not available)" |
509 |
$cf testtry $testdata/testoutput9 |
if [ $jit -ne 0 ] ; then |
510 |
if [ $? != 0 ] ; then exit 1; fi |
echo " Skipped because JIT is available" |
511 |
else exit 1 |
else |
512 |
|
$sim $valgrind ./pcretest -q $testdata/testinput15 testtry |
513 |
|
if [ $? = 0 ] ; then |
514 |
|
$cf $testdata/testoutput15 testtry |
515 |
|
if [ $? != 0 ] ; then exit 1; fi |
516 |
|
else exit 1 |
517 |
|
fi |
518 |
|
echo " OK" |
519 |
fi |
fi |
|
echo "OK" |
|
520 |
fi |
fi |
521 |
|
|
522 |
# End |
# End |