/[pcre]/code/trunk/RunTest
ViewVC logotype

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 836 - (hide annotations) (download)
Wed Dec 28 17:16:11 2011 UTC (17 months, 3 weeks ago) by ph10
File size: 21463 byte(s)
Merging all the changes from the pcre16 branch into the trunk.

1 nigel 49 #! /bin/sh
2    
3 ph10 671 # Run the PCRE tests using the pcretest program. The appropriate tests are
4     # selected, depending on which build-time options were used.
5 nigel 49
6 ph10 671 # 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 ph10 674 # two tests for JIT-specific features, one to be run when JIT support is
19 ph10 671 # available, and one when it is not.
20    
21 ph10 836 # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
22     # possible to select which to test by the arguments -8 or -16.
23    
24     # Other arguments for this script can be individual test numbers, or the word
25 ph10 691 # "valgrind", or "sim" followed by an argument to run cross-compiled
26 ph10 689 # executables under a simulator, for example:
27     #
28     # RunTest 3 sim "qemu-arm -s 8388608"
29    
30 nigel 87 valgrind=
31 ph10 689 sim=
32 ph10 836 arg8=
33     arg16=
34 ph10 339
35 ph10 116 # Select which tests to run; for those that are explicitly requested, check
36     # that the necessary optional facilities are available.
37    
38 nigel 49 do1=no
39     do2=no
40     do3=no
41     do4=no
42     do5=no
43 nigel 75 do6=no
44 nigel 77 do7=no
45     do8=no
46     do9=no
47 ph10 164 do10=no
48 ph10 448 do11=no
49     do12=no
50 ph10 651 do13=no
51 ph10 671 do14=no
52     do15=no
53 ph10 836 do16=no
54     do17=no
55     do18=no
56     do19=no
57     do20=no
58 nigel 49
59     while [ $# -gt 0 ] ; do
60     case $1 in
61     1) do1=yes;;
62     2) do2=yes;;
63     3) do3=yes;;
64     4) do4=yes;;
65 nigel 77 5) do5=yes;;
66     6) do6=yes;;
67     7) do7=yes;;
68     8) do8=yes;;
69     9) do9=yes;;
70 ph10 165 10) do10=yes;;
71 ph10 448 11) do11=yes;;
72 ph10 461 12) do12=yes;;
73 ph10 666 13) do13=yes;;
74 ph10 671 14) do14=yes;;
75     15) do15=yes;;
76 ph10 836 16) do16=yes;;
77     17) do17=yes;;
78     18) do18=yes;;
79     19) do19=yes;;
80     20) do20=yes;;
81     -8) arg8=yes;;
82     -16) arg16=yes;;
83 ph10 666 valgrind) valgrind="valgrind -q --smc-check=all";;
84 ph10 689 sim) shift; sim=$1;;
85 nigel 49 *) echo "Unknown test number $1"; exit 1;;
86     esac
87     shift
88     done
89    
90 ph10 689 # Set up a suitable "diff" command for comparison. Some systems
91     # have a diff that lacks a -u option. Try to deal with this.
92    
93     if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi
94    
95     # Find the test data
96    
97     if [ -n "$srcdir" -a -d "$srcdir" ] ; then
98     testdata="$srcdir/testdata"
99 ph10 706 elif [ -d "./testdata" ] ; then
100     testdata=./testdata
101     elif [ -d "../testdata" ] ; then
102     testdata=../testdata
103     else
104     echo "Cannot find the testdata directory"
105 ph10 708 exit 1
106 ph10 689 fi
107    
108 ph10 712 # Find which optional facilities are available. In some Windows environments
109     # the output of pcretest -C has CRLF at the end of each line, but the shell
110     # strips only linefeeds from the output of a `backquoted` command. Hence the
111     # alternative patterns.
112 ph10 689
113 ph10 836 $sim ./pcretest -C linksize >/dev/null
114     link_size=$?
115     if [ $link_size -lt 2 ] ; then
116     echo "Failed to find internal link size"
117     exit 1
118     fi
119     if [ $link_size -gt 4 ] ; then
120     echo "Failed to find internal link size"
121     exit 1
122     fi
123 ph10 689
124 ph10 836 # Both 8-bit and 16-bit character strings may be supported, but only one
125     # need be.
126 ph10 689
127 ph10 836 $sim ./pcretest -C pcre8 >/dev/null
128     support8=$?
129     $sim ./pcretest -C pcre16 >/dev/null
130     support16=$?
131     if [ $(( $support8 + $support16 )) -eq 2 ] ; then
132     test8=
133     test16=-16
134     if [ "$arg8" = yes -a "$arg16" != yes ] ; then
135     test16=skip
136     fi
137     if [ "$arg16" = yes -a "$arg8" != yes ] ; then
138     test8=skip
139     fi
140     else
141     if [ $support8 -ne 0 ] ; then
142     if [ "$arg16" = yes ] ; then
143     echo "Cannot run 16-bit library tests: 16-bit library not compiled"
144     exit 1
145     fi
146     test8=
147     test16=skip
148     else
149     if [ "$arg8" = yes ] ; then
150     echo "Cannot run 8-bit library tests: 8-bit library not compiled"
151     exit 1
152     fi
153     test8=skip
154     test16=-16
155     fi
156     fi
157    
158     # UTF support always applies to both bit sizes if both are supported; we can't
159     # have UTF-8 support without UTF-16 support (for example).
160    
161     $sim ./pcretest -C utf >/dev/null
162     utf=$?
163    
164     $sim ./pcretest -C ucp >/dev/null
165 ph10 689 ucp=$?
166    
167     jitopt=
168 ph10 836 $sim ./pcretest -C jit >/dev/null
169 ph10 689 jit=$?
170     if [ $jit -ne 0 ] ; then
171     jitopt=-s+
172     fi
173    
174 ph10 836 if [ $utf -eq 0 ] ; then
175 nigel 63 if [ $do4 = yes ] ; then
176 ph10 836 echo "Can't run test 4 because UTF support is not configured"
177 nigel 63 exit 1
178 nigel 77 fi
179 nigel 49 if [ $do5 = yes ] ; then
180 ph10 836 echo "Can't run test 5 because UTF support is not configured"
181 nigel 49 exit 1
182 nigel 77 fi
183 ph10 836 if [ $do9 = yes ] ; then
184     echo "Can't run test 8 because UTF support is not configured"
185 nigel 77 exit 1
186     fi
187 ph10 836 if [ $do15 = yes ] ; then
188     echo "Can't run test 15 because UTF support is not configured"
189 ph10 651 exit 1
190     fi
191 ph10 836 if [ $do18 = yes ] ; then
192     echo "Can't run test 18 because UTF support is not configured"
193     fi
194 nigel 77 fi
195 nigel 49
196 ph10 116 if [ $ucp -eq 0 ] ; then
197 nigel 75 if [ $do6 = yes ] ; then
198     echo "Can't run test 6 because Unicode property support is not configured"
199     exit 1
200     fi
201 ph10 836 if [ $do7 = yes ] ; then
202     echo "Can't run test 7 because Unicode property support is not configured"
203 nigel 77 exit 1
204     fi
205 ph10 164 if [ $do10 = yes ] ; then
206     echo "Can't run test 10 because Unicode property support is not configured"
207     exit 1
208     fi
209 ph10 836 if [ $do16 = yes ] ; then
210     echo "Can't run test 16 because Unicode property support is not configured"
211 ph10 448 exit 1
212     fi
213 ph10 836 if [ $do19 = yes ] ; then
214     echo "Can't run test 19 because Unicode property support is not configured"
215     exit 1
216     fi
217 nigel 77 fi
218 nigel 75
219 ph10 164 if [ $link_size -ne 2 ] ; then
220 ph10 836 if [ $do11 = yes ] ; then
221     echo "Can't run test 11 because the link size ($link_size) is not 2"
222 ph10 164 exit 1
223     fi
224 ph10 165 fi
225 ph10 164
226 ph10 671 if [ $jit -eq 0 ] ; then
227 ph10 836 if [ $do12 = "yes" ] ; then
228     echo "Can't run test 12 because JIT support is not configured"
229 ph10 671 exit 1
230     fi
231     else
232 ph10 836 if [ $do13 = "yes" ] ; then
233     echo "Can't run test 13 because JIT support is configured"
234 ph10 671 exit 1
235     fi
236 ph10 674 fi
237 ph10 116
238 ph10 671 # If no specific tests were requested, select all. Those that are not
239     # relevant will be skipped.
240    
241     if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
242     $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
243     $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
244 ph10 836 $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
245     $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no ] ; then
246 nigel 49 do1=yes
247 ph10 247 do2=yes
248 nigel 49 do3=yes
249 ph10 671 do4=yes
250     do5=yes
251     do6=yes
252 ph10 247 do7=yes
253 ph10 671 do8=yes
254     do9=yes
255     do10=yes
256 ph10 448 do11=yes
257 ph10 671 do12=yes
258     do13=yes
259     do14=yes
260     do15=yes
261 ph10 836 do16=yes
262     do17=yes
263     do18=yes
264     do19=yes
265     do20=yes
266 nigel 49 fi
267    
268 ph10 706 # Show which release and which test data
269 nigel 73
270 ph10 128 echo ""
271 ph10 706 echo PCRE C library tests using test data from $testdata
272     $sim ./pcretest /dev/null
273 nigel 73
274 ph10 836 for bmode in "$test8" "$test16"; do
275     case "$bmode" in
276     skip) continue;;
277     -16) if [ "$test8" != "skip" ] ; then echo ""; fi
278     bits=16; echo "---- Testing 16-bit library ----"; echo "";;
279     *) bits=8; echo "---- Testing 8-bit library ----"; echo "";;
280     esac
281    
282 ph10 666 # Primary test, compatible with JIT and all versions of Perl >= 5.8
283 nigel 49
284     if [ $do1 = yes ] ; then
285 ph10 836 echo "Test 1: main functionality (Compatible with Perl >= 5.10)"
286 ph10 666 for opt in "" "-s" $jitopt; do
287 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
288 ph10 612 if [ $? = 0 ] ; then
289     $cf $testdata/testoutput1 testtry
290     if [ $? != 0 ] ; then exit 1; fi
291     else exit 1
292     fi
293 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
294     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
295     else echo " OK"
296 ph10 666 fi
297 ph10 654 done
298 nigel 49 fi
299    
300 ph10 666 # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
301 nigel 49
302     if [ $do2 = yes ] ; then
303 ph10 836 echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)"
304 ph10 666 for opt in "" "-s" $jitopt; do
305 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
306 ph10 612 if [ $? = 0 ] ; then
307     $cf $testdata/testoutput2 testtry
308     if [ $? != 0 ] ; then exit 1; fi
309     else
310     echo " "
311     echo "** Test 2 requires a lot of stack. If it has crashed with a"
312     echo "** segmentation fault, it may be that you do not have enough"
313     echo "** stack available by default. Please see the 'pcrestack' man"
314     echo "** page for a discussion of PCRE's stack usage."
315     echo " "
316     exit 1
317     fi
318 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
319     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
320     else echo " OK"
321 ph10 666 fi
322 ph10 654 done
323 nigel 49 fi
324    
325 ph10 157 # Locale-specific tests, provided that either the "fr_FR" or the "french"
326     # locale is available. The former is the Unix-like standard; the latter is
327 ph10 706 # for Windows. Another possibility is "fr", which needs to be run against
328     # the Windows-specific input and output files.
329 nigel 49
330 nigel 63 if [ $do3 = yes ] ; then
331 nigel 73 locale -a | grep '^fr_FR$' >/dev/null
332 nigel 49 if [ $? -eq 0 ] ; then
333 ph10 157 locale=fr_FR
334     infile=$testdata/testinput3
335     outfile=$testdata/testoutput3
336     else
337 ph10 706 infile=test3input
338     outfile=test3output
339 ph10 157 locale -a | grep '^french$' >/dev/null
340     if [ $? -eq 0 ] ; then
341     locale=french
342     sed 's/fr_FR/french/' $testdata/testinput3 >test3input
343     sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
344     else
345 ph10 706 locale -a | grep '^fr$' >/dev/null
346     if [ $? -eq 0 ] ; then
347     locale=fr
348     sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
349     sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
350     else
351     locale=
352 ph10 708 fi
353 ph10 157 fi
354 ph10 159 fi
355 ph10 157
356     if [ "$locale" != "" ] ; then
357     echo "Test 3: locale-specific features (using '$locale' locale)"
358 ph10 666 for opt in "" "-s" $jitopt; do
359 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
360 ph10 612 if [ $? = 0 ] ; then
361     $cf $outfile testtry
362     if [ $? != 0 ] ; then
363     echo " "
364     echo "Locale test did not run entirely successfully."
365     echo "This usually means that there is a problem with the locale"
366     echo "settings rather than a bug in PCRE."
367 ph10 654 break;
368 ph10 612 else
369 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
370     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
371     else echo " OK"
372 ph10 666 fi
373 ph10 612 fi
374     else exit 1
375 nigel 77 fi
376 ph10 654 done
377 nigel 49 else
378 ph10 712 echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or"
379     echo "'french' locales exist, or the \"locale\" command is not available"
380 ph10 157 echo "to check for them."
381 nigel 77 echo " "
382 nigel 49 fi
383     fi
384    
385 ph10 836 # Additional tests for UTF support
386 nigel 49
387 nigel 63 if [ $do4 = yes ] ; then
388 ph10 836 echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.10)"
389     if [ $utf -eq 0 ] ; then
390     echo " Skipped because UTF-$bits support is not available"
391 ph10 674 else
392 ph10 671 for opt in "" "-s" $jitopt; do
393 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
394 ph10 671 if [ $? = 0 ] ; then
395     $cf $testdata/testoutput4 testtry
396     if [ $? != 0 ] ; then exit 1; fi
397     else exit 1
398     fi
399 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
400     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
401     else echo " OK"
402 ph10 671 fi
403     done
404 ph10 674 fi
405 nigel 49 fi
406    
407 nigel 63 if [ $do5 = yes ] ; then
408 ph10 836 echo "Test 5: API, internals, and non-Perl stuff for UTF-$bits support"
409     if [ $utf -eq 0 ] ; then
410     echo " Skipped because UTF-$bits support is not available"
411 ph10 674 else
412 ph10 671 for opt in "" "-s" $jitopt; do
413 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
414 ph10 671 if [ $? = 0 ] ; then
415     $cf $testdata/testoutput5 testtry
416     if [ $? != 0 ] ; then exit 1; fi
417     else exit 1
418     fi
419 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
420     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
421     else echo " OK"
422 ph10 671 fi
423     done
424 ph10 674 fi
425 nigel 49 fi
426    
427 nigel 75 if [ $do6 = yes ] ; then
428 ph10 559 echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"
429 ph10 836 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
430 ph10 671 echo " Skipped because Unicode property support is not available"
431 ph10 674 else
432 ph10 671 for opt in "" "-s" $jitopt; do
433 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
434 ph10 671 if [ $? = 0 ] ; then
435     $cf $testdata/testoutput6 testtry
436     if [ $? != 0 ] ; then exit 1; fi
437     else exit 1
438     fi
439 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
440     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
441     else echo " OK"
442 ph10 671 fi
443     done
444 ph10 674 fi
445 nigel 75 fi
446    
447 ph10 836 # Test non-Perl-compatible Unicode property support
448    
449     if [ $do7 = yes ] ; then
450     echo "Test 7: API, internals, and non-Perl stuff for Unicode property support"
451     if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
452     echo " Skipped because Unicode property support is not available"
453     else
454     for opt in "" "-s" $jitopt; do
455     $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
456     if [ $? = 0 ] ; then
457     $cf $testdata/testoutput7 testtry
458     if [ $? != 0 ] ; then exit 1; fi
459     else exit 1
460     fi
461     if [ "$opt" = "-s" ] ; then echo " OK with study"
462     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
463     else echo " OK"
464     fi
465     done
466     fi
467     fi
468    
469 nigel 77 # Tests for DFA matching support
470    
471 ph10 836 if [ $do8 = yes ] ; then
472     echo "Test 8: DFA matching main functionality"
473 ph10 654 for opt in "" "-s"; do
474 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
475 ph10 612 if [ $? = 0 ] ; then
476 ph10 836 $cf $testdata/testoutput8 testtry
477 ph10 612 if [ $? != 0 ] ; then exit 1; fi
478     else exit 1
479     fi
480 ph10 671 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
481 ph10 654 done
482 nigel 77 fi
483    
484 ph10 836 if [ $do9 = yes ] ; then
485     echo "Test 9: DFA matching with UTF-$bits"
486     if [ $utf -eq 0 ] ; then
487     echo " Skipped because UTF-$bits support is not available"
488 ph10 674 else
489 ph10 671 for opt in "" "-s"; do
490 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
491 ph10 671 if [ $? = 0 ] ; then
492 ph10 836 $cf $testdata/testoutput9 testtry
493 ph10 671 if [ $? != 0 ] ; then exit 1; fi
494     else exit 1
495     fi
496     if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
497     done
498 ph10 674 fi
499 nigel 77 fi
500    
501 ph10 836 if [ $do10 = yes ] ; then
502     echo "Test 10: DFA matching with Unicode properties"
503     if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
504 ph10 671 echo " Skipped because Unicode property support is not available"
505 ph10 674 else
506 ph10 671 for opt in "" "-s"; do
507 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
508 ph10 671 if [ $? = 0 ] ; then
509 ph10 836 $cf $testdata/testoutput10 testtry
510 ph10 671 if [ $? != 0 ] ; then exit 1; fi
511     else exit 1
512     fi
513     if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
514     done
515 ph10 674 fi
516 nigel 77 fi
517    
518 ph10 164 # Test of internal offsets and code sizes. This test is run only when there
519     # is Unicode property support and the link size is 2. The actual tests are
520     # mostly the same as in some of the above, but in this test we inspect some
521     # offsets and sizes that require a known link size. This is a doublecheck for
522 ph10 836 # the maintainer, just in case something changes unexpectely. The output from
523     # this test is not the same in 8-bit and 16-bit modes.
524 ph10 164
525 ph10 836 if [ $do11 = yes ] ; then
526     echo "Test 11: Internal offsets and code size tests"
527 ph10 674 if [ $link_size -ne 2 ] ; then
528 ph10 671 echo " Skipped because link size is not 2"
529 ph10 674 elif [ $ucp -eq 0 ] ; then
530 ph10 671 echo " Skipped because Unicode property support is not available"
531 ph10 674 else
532 ph10 671 for opt in "" "-s"; do
533 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
534 ph10 671 if [ $? = 0 ] ; then
535 ph10 836 $cf $testdata/testoutput11-$bits testtry
536 ph10 671 if [ $? != 0 ] ; then exit 1; fi
537     else exit 1
538     fi
539     if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
540     done
541 ph10 674 fi
542 ph10 164 fi
543    
544 ph10 836 # Test JIT-specific features when JIT is available
545 ph10 448
546 ph10 836 if [ $do12 = yes ] ; then
547     echo "Test 12: JIT-specific features (JIT available)"
548     if [ $jit -eq 0 ] ; then
549     echo " Skipped because JIT is not available or not usable"
550     else
551     $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
552 ph10 612 if [ $? = 0 ] ; then
553 ph10 836 $cf $testdata/testoutput12 testtry
554 ph10 612 if [ $? != 0 ] ; then exit 1; fi
555     else exit 1
556     fi
557 ph10 836 echo " OK"
558     fi
559     fi
560    
561     # Test JIT-specific features when JIT is not available
562    
563     if [ $do13 = yes ] ; then
564     echo "Test 13: JIT-specific features (JIT not available)"
565     if [ $jit -ne 0 ] ; then
566     echo " Skipped because JIT is available"
567     else
568     $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
569     if [ $? = 0 ] ; then
570     $cf $testdata/testoutput13 testtry
571     if [ $? != 0 ] ; then exit 1; fi
572     else exit 1
573 ph10 666 fi
574 ph10 836 echo " OK"
575     fi
576 ph10 448 fi
577    
578 ph10 836 # Tests for 8-bit-specific features
579 ph10 448
580 ph10 836 if [ "$do14" = yes ] ; then
581     echo "Test 14: specials for the basic 8-bit library"
582     if [ "$bits" = "16" ] ; then
583     echo " Skipped when running 16-bit tests"
584     elif [ $utf -eq 0 ] ; then
585     echo " Skipped because UTF-$bits support is not available"
586     else
587 ph10 671 for opt in "" "-s" $jitopt; do
588 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
589 ph10 671 if [ $? = 0 ] ; then
590 ph10 836 $cf $testdata/testoutput14 testtry
591 ph10 671 if [ $? != 0 ] ; then exit 1; fi
592     else exit 1
593     fi
594 ph10 674 if [ "$opt" = "-s" ] ; then echo " OK with study"
595     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
596     else echo " OK"
597 ph10 671 fi
598     done
599 ph10 674 fi
600 ph10 448 fi
601    
602 ph10 836 # Tests for 8-bit-specific features (needs UTF-8 support)
603 ph10 651
604 ph10 836 if [ "$do15" = yes ] ; then
605     echo "Test 15: specials for the 8-bit library with UTF-8 support"
606     if [ "$bits" = "16" ] ; then
607     echo " Skipped when running 16-bit tests"
608     elif [ $utf -eq 0 ] ; then
609     echo " Skipped because UTF-$bits support is not available"
610     else
611     for opt in "" "-s" $jitopt; do
612     $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
613     if [ $? = 0 ] ; then
614     $cf $testdata/testoutput15 testtry
615     if [ $? != 0 ] ; then exit 1; fi
616     else exit 1
617     fi
618     if [ "$opt" = "-s" ] ; then echo " OK with study"
619     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
620     else echo " OK"
621     fi
622     done
623     fi
624     fi
625    
626     # Tests for 8-bit-specific features (Unicode property support)
627    
628     if [ $do16 = yes ] ; then
629     echo "Test 16: specials for the 8-bit library with Unicode propery support"
630     if [ "$bits" = "16" ] ; then
631     echo " Skipped when running 16-bit tests"
632     elif [ $ucp -eq 0 ] ; then
633 ph10 671 echo " Skipped because Unicode property support is not available"
634 ph10 836 else
635 ph10 671 for opt in "" "-s" $jitopt; do
636 ph10 836 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
637 ph10 671 if [ $? = 0 ] ; then
638 ph10 836 $cf $testdata/testoutput16 testtry
639 ph10 671 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 ph10 671 fi
649    
650 ph10 836 # Tests for 16-bit-specific features
651 ph10 671
652 ph10 836 if [ $do17 = yes ] ; then
653     echo "Test 17: specials for the basic 16-bit library"
654     if [ "$bits" = "8" ] ; then
655     echo " Skipped when running 8-bit tests"
656     else
657     for opt in "" "-s" $jitopt; do
658     $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
659     if [ $? = 0 ] ; then
660     $cf $testdata/testoutput17 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 ph10 674 fi
670 ph10 671 fi
671 ph10 674
672 ph10 836 # Tests for 16-bit-specific features (UTF-16 support)
673 ph10 671
674 ph10 836 if [ $do18 = yes ] ; then
675     echo "Test 18: specials for the 16-bit library with UTF-16 support"
676     if [ "$bits" = "8" ] ; then
677     echo " Skipped when running 8-bit tests"
678     elif [ $utf -eq 0 ] ; then
679     echo " Skipped because UTF-$bits support is not available"
680     else
681     for opt in "" "-s" $jitopt; do
682     $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
683     if [ $? = 0 ] ; then
684     $cf $testdata/testoutput18 testtry
685     if [ $? != 0 ] ; then exit 1; fi
686     else exit 1
687     fi
688     if [ "$opt" = "-s" ] ; then echo " OK with study"
689     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
690     else echo " OK"
691     fi
692     done
693 ph10 674 fi
694 ph10 651 fi
695    
696 ph10 836 # Tests for 16-bit-specific features (Unicode property support)
697    
698     if [ $do19 = yes ] ; then
699     echo "Test 19: specials for the 16-bit library with Unicode propery support"
700     if [ "$bits" = "8" ] ; then
701     echo " Skipped when running 8-bit tests"
702     elif [ $ucp -eq 0 ] ; then
703     echo " Skipped because Unicode property support is not available"
704     else
705     for opt in "" "-s" $jitopt; do
706     $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
707     if [ $? = 0 ] ; then
708     $cf $testdata/testoutput19 testtry
709     if [ $? != 0 ] ; then exit 1; fi
710     else exit 1
711     fi
712     if [ "$opt" = "-s" ] ; then echo " OK with study"
713     elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
714     else echo " OK"
715     fi
716     done
717     fi
718     fi
719    
720     # Tests for 16-bit-specific features in DFA non-UTF-16 mode
721    
722     if [ $do20 = yes ] ; then
723     echo "Test 20: DFA specials for the basic 16-bit library"
724     if [ "$bits" = "8" ] ; then
725     echo " Skipped when running 8-bit tests"
726     else
727     for opt in "" "-s"; do
728     $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry
729     if [ $? = 0 ] ; then
730     $cf $testdata/testoutput20 testtry
731     if [ $? != 0 ] ; then exit 1; fi
732     else exit 1
733     fi
734     if [ "$opt" = "-s" ] ; then echo " OK with study"
735     else echo " OK"
736     fi
737     done
738     fi
739     fi
740    
741     # End of loop for 8-bit/16-bit tests
742     done
743    
744 nigel 49 # End

Properties

Name Value
svn:executable *
svn:keywords "Author Date Id Revision Url"

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12