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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1055 - (show annotations)
Tue Oct 16 15:53:30 2012 UTC (7 years, 1 month ago) by chpe
File size: 28709 byte(s)
Error occurred while calculating annotation data.
pcre32: Add 32-bit library

Create libpcre32 that operates on 32-bit characters (UTF-32).

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5