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 |
valgrind= |
# All tests are now run both with and without -s, to ensure that everything is |
7 |
|
# tested with and without studying. However, there are some tests that produce |
8 |
|
# 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 |
|
# tests are duplicated in the files, one with /S to force studying always, and |
11 |
|
# one with /SS to force *not* studying always. The use of -s doesn't then make |
12 |
|
# 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 |
|
# 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 |
# Set up a suitable "diff" command for comparison. Some systems |
valgrind= |
28 |
# have a diff that lacks a -u option. Try to deal with this. |
sim= |
|
|
|
|
if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi |
|
|
|
|
|
# Find the test data |
|
|
|
|
|
testdata=testdata |
|
|
if [ -n "$srcdir" -a -d "$srcdir" ] ; then |
|
|
testdata="$srcdir/testdata" |
|
|
fi |
|
|
|
|
|
# Find which optional facilities are available |
|
|
|
|
|
case `./pcretest -C | ./pcregrep 'Internal link size'` in |
|
|
*2) link_size=2;; |
|
|
*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. |
42 |
do10=no |
do10=no |
43 |
do11=no |
do11=no |
44 |
do12=no |
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 |
60 |
10) do10=yes;; |
10) do10=yes;; |
61 |
11) do11=yes;; |
11) do11=yes;; |
62 |
12) do12=yes;; |
12) do12=yes;; |
63 |
valgrind) valgrind="valgrind -q";; |
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 |
|
# Set up a suitable "diff" command for comparison. Some systems |
74 |
|
# have a diff that lacks a -u option. Try to deal with this. |
75 |
|
|
76 |
|
if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi |
77 |
|
|
78 |
|
# Find the test data |
79 |
|
|
80 |
|
if [ -n "$srcdir" -a -d "$srcdir" ] ; then |
81 |
|
testdata="$srcdir/testdata" |
82 |
|
elif [ -d "./testdata" ] ; then |
83 |
|
testdata=./testdata |
84 |
|
elif [ -d "../testdata" ] ; then |
85 |
|
testdata=../testdata |
86 |
|
else |
87 |
|
echo "Cannot find the testdata directory" |
88 |
|
exit 1 |
89 |
|
fi |
90 |
|
|
91 |
|
# Find which optional facilities are available |
92 |
|
|
93 |
|
case `$sim ./pcretest -C | $sim ./pcregrep 'Internal link size'` in |
94 |
|
*2) link_size=2;; |
95 |
|
*3) link_size=3;; |
96 |
|
*4) link_size=4;; |
97 |
|
*) echo "Failed to find internal link size"; exit 1;; |
98 |
|
esac |
99 |
|
|
100 |
|
$sim ./pcretest -C | $sim ./pcregrep 'No UTF-8 support' >/dev/null |
101 |
|
utf8=$? |
102 |
|
|
103 |
|
$sim ./pcretest -C | $sim ./pcregrep 'No Unicode properties support' >/dev/null |
104 |
|
ucp=$? |
105 |
|
|
106 |
|
jitopt= |
107 |
|
$sim ./pcretest -C | $sim ./pcregrep 'No just-in-time compiler support' \ |
108 |
|
>/dev/null |
109 |
|
jit=$? |
110 |
|
if [ $jit -ne 0 ] ; then |
111 |
|
jitopt=-s+ |
112 |
|
fi |
113 |
|
|
114 |
if [ $utf8 -eq 0 ] ; then |
if [ $utf8 -eq 0 ] ; then |
115 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
116 |
echo "Can't run test 4 because UTF-8 support is not configured" |
echo "Can't run test 4 because UTF-8 support is not configured" |
124 |
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" |
125 |
exit 1 |
exit 1 |
126 |
fi |
fi |
127 |
|
if [ $do12 = yes ] ; then |
128 |
|
echo "Can't run test 12 because UTF-8 support is not configured" |
129 |
|
exit 1 |
130 |
|
fi |
131 |
fi |
fi |
132 |
|
|
133 |
if [ $ucp -eq 0 ] ; then |
if [ $ucp -eq 0 ] ; then |
143 |
echo "Can't run test 10 because Unicode property support is not configured" |
echo "Can't run test 10 because Unicode property support is not configured" |
144 |
exit 1 |
exit 1 |
145 |
fi |
fi |
146 |
if [ $do12 = yes ] ; then |
if [ $do13 = yes ] ; then |
147 |
echo "Can't run test 12 because Unicode property support is not configured" |
echo "Can't run test 12 because Unicode property support is not configured" |
148 |
exit 1 |
exit 1 |
149 |
fi |
fi |
156 |
fi |
fi |
157 |
fi |
fi |
158 |
|
|
159 |
# If no specific tests were requested, select all that are relevant. |
if [ $jit -eq 0 ] ; then |
160 |
|
if [ $do14 = "yes" ] ; then |
161 |
|
echo "Can't run test 14 because JIT support is not configured" |
162 |
|
exit 1 |
163 |
|
fi |
164 |
|
else |
165 |
|
if [ $do15 = "yes" ] ; then |
166 |
|
echo "Can't run test 15 because JIT support is configured" |
167 |
|
exit 1 |
168 |
|
fi |
169 |
|
fi |
170 |
|
|
171 |
|
# If no specific tests were requested, select all. Those that are not |
172 |
|
# relevant will be skipped. |
173 |
|
|
174 |
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 \ |
175 |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
$do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \ |
176 |
$do9 = no -a $do10 = no -a $do11 = no -a $do12 = no ] ; then |
$do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \ |
177 |
|
$do13 = no -a $do14 = no -a $do15 = no ] ; then |
178 |
do1=yes |
do1=yes |
179 |
do2=yes |
do2=yes |
180 |
do3=yes |
do3=yes |
181 |
if [ $utf8 -ne 0 ] ; then do4=yes; fi |
do4=yes |
182 |
if [ $utf8 -ne 0 ] ; then do5=yes; fi |
do5=yes |
183 |
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do6=yes; fi |
do6=yes |
184 |
do7=yes |
do7=yes |
185 |
if [ $utf8 -ne 0 ] ; then do8=yes; fi |
do8=yes |
186 |
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do9=yes; fi |
do9=yes |
187 |
if [ $link_size -eq 2 -a $ucp -ne 0 ] ; then do10=yes; fi |
do10=yes |
188 |
do11=yes |
do11=yes |
189 |
if [ $utf8 -ne 0 -a $ucp -ne 0 ] ; then do12=yes; fi |
do12=yes |
190 |
|
do13=yes |
191 |
|
do14=yes |
192 |
|
do15=yes |
193 |
fi |
fi |
194 |
|
|
195 |
# Show which release |
# Show which release and which test data |
196 |
|
|
197 |
echo "" |
echo "" |
198 |
echo PCRE C library tests |
echo PCRE C library tests using test data from $testdata |
199 |
./pcretest /dev/null |
$sim ./pcretest /dev/null |
200 |
|
|
201 |
# Primary test, Perl-compatible for both 5.8 and 5.10 |
# Primary test, compatible with JIT and all versions of Perl >= 5.8 |
202 |
|
|
203 |
if [ $do1 = yes ] ; then |
if [ $do1 = yes ] ; then |
204 |
echo "Test 1: main functionality (Perl 5.8 & 5.10 compatible)" |
echo "Test 1: main functionality (Compatible with Perl >= 5.8)" |
205 |
$valgrind ./pcretest -q $testdata/testinput1 testtry |
for opt in "" "-s" $jitopt; do |
206 |
if [ $? = 0 ] ; then |
$sim $valgrind ./pcretest -q $opt $testdata/testinput1 testtry |
207 |
$cf $testdata/testoutput1 testtry |
if [ $? = 0 ] ; then |
208 |
if [ $? != 0 ] ; then exit 1; fi |
$cf $testdata/testoutput1 testtry |
209 |
else exit 1 |
if [ $? != 0 ] ; then exit 1; fi |
210 |
fi |
else exit 1 |
211 |
echo "OK" |
fi |
212 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
213 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
214 |
|
else echo " OK" |
215 |
|
fi |
216 |
|
done |
217 |
fi |
fi |
218 |
|
|
219 |
# PCRE tests that are not Perl-compatible - API, errors, internals |
# PCRE tests that are not JIT or Perl-compatible: API, errors, internals |
220 |
|
|
221 |
if [ $do2 = yes ] ; then |
if [ $do2 = yes ] ; then |
222 |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
echo "Test 2: API, errors, internals, and non-Perl stuff" |
223 |
$valgrind ./pcretest -q $testdata/testinput2 testtry |
for opt in "" "-s" $jitopt; do |
224 |
if [ $? = 0 ] ; then |
$sim $valgrind ./pcretest -q $opt $testdata/testinput2 testtry |
225 |
$cf $testdata/testoutput2 testtry |
if [ $? = 0 ] ; then |
226 |
if [ $? != 0 ] ; then exit 1; fi |
$cf $testdata/testoutput2 testtry |
227 |
else |
if [ $? != 0 ] ; then exit 1; fi |
228 |
echo " " |
else |
229 |
echo "** Test 2 requires a lot of stack. If it has crashed with a" |
echo " " |
230 |
echo "** segmentation fault, it may be that you do not have enough" |
echo "** Test 2 requires a lot of stack. If it has crashed with a" |
231 |
echo "** stack available by default. Please see the 'pcrestack' man" |
echo "** segmentation fault, it may be that you do not have enough" |
232 |
echo "** page for a discussion of PCRE's stack usage." |
echo "** stack available by default. Please see the 'pcrestack' man" |
233 |
echo " " |
echo "** page for a discussion of PCRE's stack usage." |
234 |
exit 1 |
echo " " |
235 |
fi |
exit 1 |
236 |
echo "OK" |
fi |
237 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
238 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
239 |
|
else echo " OK" |
240 |
|
fi |
241 |
|
done |
242 |
fi |
fi |
243 |
|
|
244 |
# Locale-specific tests, provided that either the "fr_FR" or the "french" |
# Locale-specific tests, provided that either the "fr_FR" or the "french" |
245 |
# locale is available. The former is the Unix-like standard; the latter is |
# locale is available. The former is the Unix-like standard; the latter is |
246 |
# for Windows. |
# for Windows. Another possibility is "fr", which needs to be run against |
247 |
|
# the Windows-specific input and output files. |
248 |
|
|
249 |
if [ $do3 = yes ] ; then |
if [ $do3 = yes ] ; then |
250 |
locale -a | grep '^fr_FR$' >/dev/null |
locale -a | grep '^fr_FR$' >/dev/null |
253 |
infile=$testdata/testinput3 |
infile=$testdata/testinput3 |
254 |
outfile=$testdata/testoutput3 |
outfile=$testdata/testoutput3 |
255 |
else |
else |
256 |
|
infile=test3input |
257 |
|
outfile=test3output |
258 |
locale -a | grep '^french$' >/dev/null |
locale -a | grep '^french$' >/dev/null |
259 |
if [ $? -eq 0 ] ; then |
if [ $? -eq 0 ] ; then |
260 |
locale=french |
locale=french |
261 |
sed 's/fr_FR/french/' $testdata/testinput3 >test3input |
sed 's/fr_FR/french/' $testdata/testinput3 >test3input |
262 |
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output |
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output |
|
infile=test3input |
|
|
outfile=test3output |
|
263 |
else |
else |
264 |
locale= |
locale -a | grep '^fr$' >/dev/null |
265 |
|
if [ $? -eq 0 ] ; then |
266 |
|
locale=fr |
267 |
|
sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input |
268 |
|
sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output |
269 |
|
else |
270 |
|
locale= |
271 |
|
fi |
272 |
fi |
fi |
273 |
fi |
fi |
274 |
|
|
275 |
if [ "$locale" != "" ] ; then |
if [ "$locale" != "" ] ; then |
276 |
echo "Test 3: locale-specific features (using '$locale' locale)" |
echo "Test 3: locale-specific features (using '$locale' locale)" |
277 |
$valgrind ./pcretest -q $infile testtry |
for opt in "" "-s" $jitopt; do |
278 |
if [ $? = 0 ] ; then |
$sim $valgrind ./pcretest -q $opt $infile testtry |
279 |
$cf $outfile testtry |
if [ $? = 0 ] ; then |
280 |
if [ $? != 0 ] ; then |
$cf $outfile testtry |
281 |
echo " " |
if [ $? != 0 ] ; then |
282 |
echo "Locale test did not run entirely successfully." |
echo " " |
283 |
echo "This usually means that there is a problem with the locale" |
echo "Locale test did not run entirely successfully." |
284 |
echo "settings rather than a bug in PCRE." |
echo "This usually means that there is a problem with the locale" |
285 |
else |
echo "settings rather than a bug in PCRE." |
286 |
echo "OK" |
break; |
287 |
|
else |
288 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
289 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
290 |
|
else echo " OK" |
291 |
|
fi |
292 |
|
fi |
293 |
|
else exit 1 |
294 |
fi |
fi |
295 |
else exit 1 |
done |
|
fi |
|
296 |
else |
else |
297 |
echo "Cannot test locale-specific features - neither the 'fr_FR' nor the" |
echo "Cannot test locale-specific features - neither the 'fr_FR' nor the" |
298 |
echo "'french' locale exists, or the \"locale\" command is not available" |
echo "'french' locale exists, or the \"locale\" command is not available" |
304 |
# Additional tests for UTF8 support |
# Additional tests for UTF8 support |
305 |
|
|
306 |
if [ $do4 = yes ] ; then |
if [ $do4 = yes ] ; then |
307 |
echo "Test 4: UTF-8 support (Perl 5.8 & 5.10 compatible)" |
echo "Test 4: UTF-8 support (Compatible with Perl >= 5.8)" |
308 |
$valgrind ./pcretest -q $testdata/testinput4 testtry |
if [ $utf8 -eq 0 ] ; then |
309 |
if [ $? = 0 ] ; then |
echo " Skipped because UTF-8 support is not available" |
310 |
$cf $testdata/testoutput4 testtry |
else |
311 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s" $jitopt; do |
312 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt $testdata/testinput4 testtry |
313 |
|
if [ $? = 0 ] ; then |
314 |
|
$cf $testdata/testoutput4 testtry |
315 |
|
if [ $? != 0 ] ; then exit 1; fi |
316 |
|
else exit 1 |
317 |
|
fi |
318 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
319 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
320 |
|
else echo " OK" |
321 |
|
fi |
322 |
|
done |
323 |
fi |
fi |
|
echo "OK" |
|
324 |
fi |
fi |
325 |
|
|
326 |
if [ $do5 = yes ] ; then |
if [ $do5 = yes ] ; then |
327 |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
echo "Test 5: API, internals, and non-Perl stuff for UTF-8 support" |
328 |
$valgrind ./pcretest -q $testdata/testinput5 testtry |
if [ $utf8 -eq 0 ] ; then |
329 |
if [ $? = 0 ] ; then |
echo " Skipped because UTF-8 support is not available" |
330 |
$cf $testdata/testoutput5 testtry |
else |
331 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s" $jitopt; do |
332 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt $testdata/testinput5 testtry |
333 |
|
if [ $? = 0 ] ; then |
334 |
|
$cf $testdata/testoutput5 testtry |
335 |
|
if [ $? != 0 ] ; then exit 1; fi |
336 |
|
else exit 1 |
337 |
|
fi |
338 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
339 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
340 |
|
else echo " OK" |
341 |
|
fi |
342 |
|
done |
343 |
fi |
fi |
|
echo "OK" |
|
344 |
fi |
fi |
345 |
|
|
346 |
if [ $do6 = yes ] ; then |
if [ $do6 = yes ] ; then |
347 |
echo "Test 6: Unicode property support (Perl 5.10 compatible)" |
echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)" |
348 |
$valgrind ./pcretest -q $testdata/testinput6 testtry |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
349 |
if [ $? = 0 ] ; then |
echo " Skipped because Unicode property support is not available" |
350 |
$cf $testdata/testoutput6 testtry |
else |
351 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s" $jitopt; do |
352 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt $testdata/testinput6 testtry |
353 |
|
if [ $? = 0 ] ; then |
354 |
|
$cf $testdata/testoutput6 testtry |
355 |
|
if [ $? != 0 ] ; then exit 1; fi |
356 |
|
else exit 1 |
357 |
|
fi |
358 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
359 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
360 |
|
else echo " OK" |
361 |
|
fi |
362 |
|
done |
363 |
fi |
fi |
|
echo "OK" |
|
364 |
fi |
fi |
365 |
|
|
366 |
# Tests for DFA matching support |
# Tests for DFA matching support |
367 |
|
|
368 |
if [ $do7 = yes ] ; then |
if [ $do7 = yes ] ; then |
369 |
echo "Test 7: DFA matching" |
echo "Test 7: DFA matching" |
370 |
$valgrind ./pcretest -q -dfa $testdata/testinput7 testtry |
for opt in "" "-s"; do |
371 |
if [ $? = 0 ] ; then |
$sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput7 testtry |
372 |
$cf $testdata/testoutput7 testtry |
if [ $? = 0 ] ; then |
373 |
if [ $? != 0 ] ; then exit 1; fi |
$cf $testdata/testoutput7 testtry |
374 |
else exit 1 |
if [ $? != 0 ] ; then exit 1; fi |
375 |
fi |
else exit 1 |
376 |
echo "OK" |
fi |
377 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
378 |
|
done |
379 |
fi |
fi |
380 |
|
|
381 |
if [ $do8 = yes ] ; then |
if [ $do8 = yes ] ; then |
382 |
echo "Test 8: DFA matching with UTF-8" |
echo "Test 8: DFA matching with UTF-8" |
383 |
$valgrind ./pcretest -q -dfa $testdata/testinput8 testtry |
if [ $utf8 -eq 0 ] ; then |
384 |
if [ $? = 0 ] ; then |
echo " Skipped because UTF-8 support is not available" |
385 |
$cf $testdata/testoutput8 testtry |
else |
386 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s"; do |
387 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput8 testtry |
388 |
|
if [ $? = 0 ] ; then |
389 |
|
$cf $testdata/testoutput8 testtry |
390 |
|
if [ $? != 0 ] ; then exit 1; fi |
391 |
|
else exit 1 |
392 |
|
fi |
393 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
394 |
|
done |
395 |
fi |
fi |
|
echo "OK" |
|
396 |
fi |
fi |
397 |
|
|
398 |
if [ $do9 = yes ] ; then |
if [ $do9 = yes ] ; then |
399 |
echo "Test 9: DFA matching with Unicode properties" |
echo "Test 9: DFA matching with Unicode properties" |
400 |
$valgrind ./pcretest -q -dfa $testdata/testinput9 testtry |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
401 |
if [ $? = 0 ] ; then |
echo " Skipped because Unicode property support is not available" |
402 |
$cf $testdata/testoutput9 testtry |
else |
403 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s"; do |
404 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt -dfa $testdata/testinput9 testtry |
405 |
|
if [ $? = 0 ] ; then |
406 |
|
$cf $testdata/testoutput9 testtry |
407 |
|
if [ $? != 0 ] ; then exit 1; fi |
408 |
|
else exit 1 |
409 |
|
fi |
410 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
411 |
|
done |
412 |
fi |
fi |
|
echo "OK" |
|
413 |
fi |
fi |
414 |
|
|
415 |
# Test of internal offsets and code sizes. This test is run only when there |
# Test of internal offsets and code sizes. This test is run only when there |
420 |
|
|
421 |
if [ $do10 = yes ] ; then |
if [ $do10 = yes ] ; then |
422 |
echo "Test 10: Internal offsets and code size tests" |
echo "Test 10: Internal offsets and code size tests" |
423 |
$valgrind ./pcretest -q $testdata/testinput10 testtry |
if [ $link_size -ne 2 ] ; then |
424 |
if [ $? = 0 ] ; then |
echo " Skipped because link size is not 2" |
425 |
$cf $testdata/testoutput10 testtry |
elif [ $ucp -eq 0 ] ; then |
426 |
if [ $? != 0 ] ; then exit 1; fi |
echo " Skipped because Unicode property support is not available" |
427 |
else exit 1 |
else |
428 |
|
for opt in "" "-s"; do |
429 |
|
$sim $valgrind ./pcretest -q $opt $testdata/testinput10 testtry |
430 |
|
if [ $? = 0 ] ; then |
431 |
|
$cf $testdata/testoutput10 testtry |
432 |
|
if [ $? != 0 ] ; then exit 1; fi |
433 |
|
else exit 1 |
434 |
|
fi |
435 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi |
436 |
|
done |
437 |
fi |
fi |
|
echo "OK" |
|
438 |
fi |
fi |
439 |
|
|
440 |
# Test of Perl 5.10 features |
# Test of Perl >= 5.10 features without UTF8 support |
441 |
|
|
442 |
if [ $do11 = yes ] ; then |
if [ $do11 = yes ] ; then |
443 |
echo "Test 11: Perl 5.10 features" |
echo "Test 11: Features from Perl >= 5.10 without UTF8 support" |
444 |
$valgrind ./pcretest -q $testdata/testinput11 testtry |
for opt in "" "-s" $jitopt; do |
445 |
if [ $? = 0 ] ; then |
$sim $valgrind ./pcretest -q $opt $testdata/testinput11 testtry |
446 |
$cf $testdata/testoutput11 testtry |
if [ $? = 0 ] ; then |
447 |
if [ $? != 0 ] ; then exit 1; fi |
$cf $testdata/testoutput11 testtry |
448 |
else exit 1 |
if [ $? != 0 ] ; then exit 1; fi |
449 |
|
else exit 1 |
450 |
|
fi |
451 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
452 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
453 |
|
else echo " OK" |
454 |
|
fi |
455 |
|
done |
456 |
|
fi |
457 |
|
|
458 |
|
# Test of Perl >= 5.10 features with UTF8 support |
459 |
|
|
460 |
|
if [ $do12 = yes ] ; then |
461 |
|
echo "Test 12: Features from Perl >= 5.10 with UTF8 support" |
462 |
|
if [ $utf8 -eq 0 ] ; then |
463 |
|
echo " Skipped because UTF-8 support is not available" |
464 |
|
else |
465 |
|
for opt in "" "-s" $jitopt; do |
466 |
|
$sim $valgrind ./pcretest -q $opt $testdata/testinput12 testtry |
467 |
|
if [ $? = 0 ] ; then |
468 |
|
$cf $testdata/testoutput12 testtry |
469 |
|
if [ $? != 0 ] ; then exit 1; fi |
470 |
|
else exit 1 |
471 |
|
fi |
472 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
473 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
474 |
|
else echo " OK" |
475 |
|
fi |
476 |
|
done |
477 |
fi |
fi |
|
echo "OK" |
|
478 |
fi |
fi |
479 |
|
|
480 |
# Test non-Perl-compatible Unicode property support |
# Test non-Perl-compatible Unicode property support |
481 |
|
|
482 |
if [ $do12 = yes ] ; then |
if [ $do13 = yes ] ; then |
483 |
echo "Test 12: API, internals, and non-Perl stuff for Unicode property support" |
echo "Test 13: API, internals, and non-Perl stuff for Unicode property support" |
484 |
$valgrind ./pcretest -q $testdata/testinput12 testtry |
if [ $utf8 -eq 0 -o $ucp -eq 0 ] ; then |
485 |
if [ $? = 0 ] ; then |
echo " Skipped because Unicode property support is not available" |
486 |
$cf $testdata/testoutput12 testtry |
else |
487 |
if [ $? != 0 ] ; then exit 1; fi |
for opt in "" "-s" $jitopt; do |
488 |
else exit 1 |
$sim $valgrind ./pcretest -q $opt $testdata/testinput13 testtry |
489 |
|
if [ $? = 0 ] ; then |
490 |
|
$cf $testdata/testoutput13 testtry |
491 |
|
if [ $? != 0 ] ; then exit 1; fi |
492 |
|
else exit 1 |
493 |
|
fi |
494 |
|
if [ "$opt" = "-s" ] ; then echo " OK with study" |
495 |
|
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study" |
496 |
|
else echo " OK" |
497 |
|
fi |
498 |
|
done |
499 |
|
fi |
500 |
|
fi |
501 |
|
|
502 |
|
# Test JIT-specific features when JIT is available |
503 |
|
|
504 |
|
if [ $do14 = yes ] ; then |
505 |
|
echo "Test 14: JIT-specific features (JIT available)" |
506 |
|
if [ $jit -eq 0 ] ; then |
507 |
|
echo " Skipped because JIT is not available or not usable" |
508 |
|
else |
509 |
|
$sim $valgrind ./pcretest -q $testdata/testinput14 testtry |
510 |
|
if [ $? = 0 ] ; then |
511 |
|
$cf $testdata/testoutput14 testtry |
512 |
|
if [ $? != 0 ] ; then exit 1; fi |
513 |
|
else exit 1 |
514 |
|
fi |
515 |
|
echo " OK" |
516 |
|
fi |
517 |
|
fi |
518 |
|
|
519 |
|
# Test JIT-specific features when JIT is not available |
520 |
|
|
521 |
|
if [ $do15 = yes ] ; then |
522 |
|
echo "Test 15: JIT-specific features (JIT not available)" |
523 |
|
if [ $jit -ne 0 ] ; then |
524 |
|
echo " Skipped because JIT is available" |
525 |
|
else |
526 |
|
$sim $valgrind ./pcretest -q $testdata/testinput15 testtry |
527 |
|
if [ $? = 0 ] ; then |
528 |
|
$cf $testdata/testoutput15 testtry |
529 |
|
if [ $? != 0 ] ; then exit 1; fi |
530 |
|
else exit 1 |
531 |
|
fi |
532 |
|
echo " OK" |
533 |
fi |
fi |
|
echo "OK" |
|
534 |
fi |
fi |
535 |
|
|
536 |
# End |
# End |