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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1173 - (show annotations)
Wed Oct 24 18:14:10 2012 UTC (6 years, 11 months ago) by chpe
File size: 28961 byte(s)
tests: Revert change to how valgrind is run

Use -q and don't keep a log file.
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", "valgrind-log" or "sim" followed by an argument to run cross-
26 # compiled 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 -q --smc-check=all";;
225 valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
226 sim) shift; sim=$1;;
227 *) echo "Unknown test number '$1'"; exit 1;;
228 esac
229 shift
230 done
231
232 # Find which optional facilities are available.
233
234 $sim ./pcretest -C linksize >/dev/null
235 link_size=$?
236 if [ $link_size -lt 2 ] ; then
237 echo "Failed to find internal link size"
238 exit 1
239 fi
240 if [ $link_size -gt 4 ] ; then
241 echo "Failed to find internal link size"
242 exit 1
243 fi
244
245 # All of 8-bit, 16-bit, and 32-bit character strings may be supported, but only
246 # one need be.
247
248 $sim ./pcretest -C pcre8 >/dev/null
249 support8=$?
250 $sim ./pcretest -C pcre16 >/dev/null
251 support16=$?
252 $sim ./pcretest -C pcre32 >/dev/null
253 support32=$?
254
255 # Initialize all bitsizes skipped
256
257 test8=skip
258 test16=skip
259 test32=skip
260
261 # If no bitsize arguments, select all that are available
262
263 if [ "$arg8$arg16$arg32" = "" ] ; then
264 if [ $support8 -ne 0 ] ; then
265 test8=
266 fi
267 if [ $support16 -ne 0 ] ; then
268 test16=-16
269 fi
270 if [ $support32 -ne 0 ] ; then
271 test32=-32
272 fi
273
274 # Select requested bit sizes
275
276 else
277 if [ "$arg8" = yes ] ; then
278 if [ $support8 -eq 0 ] ; then
279 echo "Cannot run 8-bit library tests: 8-bit library not compiled"
280 exit 1
281 fi
282 test8=
283 fi
284 if [ "$arg16" = yes ] ; then
285 if [ $support16 -eq 0 ] ; then
286 echo "Cannot run 16-bit library tests: 16-bit library not compiled"
287 exit 1
288 fi
289 test16=-16
290 fi
291 if [ "$arg32" = yes ] ; then
292 if [ $support32 -eq 0 ] ; then
293 echo "Cannot run 32-bit library tests: 32-bit library not compiled"
294 exit 1
295 fi
296 test32=-32
297 fi
298 fi
299
300 # UTF support always applies to all bit sizes if both are supported; we can't
301 # have UTF-8 support without UTF-16 support (for example).
302
303 $sim ./pcretest -C utf >/dev/null
304 utf=$?
305
306 $sim ./pcretest -C ucp >/dev/null
307 ucp=$?
308
309 jitopt=
310 $sim ./pcretest -C jit >/dev/null
311 jit=$?
312 if [ $jit -ne 0 ] ; then
313 jitopt=-s+
314 fi
315
316 if [ $utf -eq 0 ] ; then
317 if [ $do4 = yes ] ; then
318 echo "Can't run test 4 because UTF support is not configured"
319 exit 1
320 fi
321 if [ $do5 = yes ] ; then
322 echo "Can't run test 5 because UTF support is not configured"
323 exit 1
324 fi
325 if [ $do9 = yes ] ; then
326 echo "Can't run test 8 because UTF support is not configured"
327 exit 1
328 fi
329 if [ $do15 = yes ] ; then
330 echo "Can't run test 15 because UTF support is not configured"
331 exit 1
332 fi
333 if [ $do18 = yes ] ; then
334 echo "Can't run test 18 because UTF support is not configured"
335 fi
336 if [ $do22 = yes ] ; then
337 echo "Can't run test 22 because UTF support is not configured"
338 fi
339 fi
340
341 if [ $ucp -eq 0 ] ; then
342 if [ $do6 = yes ] ; then
343 echo "Can't run test 6 because Unicode property support is not configured"
344 exit 1
345 fi
346 if [ $do7 = yes ] ; then
347 echo "Can't run test 7 because Unicode property support is not configured"
348 exit 1
349 fi
350 if [ $do10 = yes ] ; then
351 echo "Can't run test 10 because Unicode property support is not configured"
352 exit 1
353 fi
354 if [ $do16 = yes ] ; then
355 echo "Can't run test 16 because Unicode property support is not configured"
356 exit 1
357 fi
358 if [ $do19 = yes ] ; then
359 echo "Can't run test 19 because Unicode property support is not configured"
360 exit 1
361 fi
362 fi
363
364 if [ $link_size -ne 2 ] ; then
365 if [ $do11 = yes ] ; then
366 echo "Can't run test 11 because the link size ($link_size) is not 2"
367 exit 1
368 fi
369 fi
370
371 if [ $jit -eq 0 ] ; then
372 if [ $do12 = "yes" ] ; then
373 echo "Can't run test 12 because JIT support is not configured"
374 exit 1
375 fi
376 else
377 if [ $do13 = "yes" ] ; then
378 echo "Can't run test 13 because JIT support is configured"
379 exit 1
380 fi
381 fi
382
383 # If no specific tests were requested, select all. Those that are not
384 # relevant will be skipped.
385
386 if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
387 $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
388 $do9 = no -a $do10 = no -a $do11 = no -a $do12 = no -a \
389 $do13 = no -a $do14 = no -a $do15 = no -a $do16 = no -a \
390 $do17 = no -a $do18 = no -a $do19 = no -a $do20 = no -a \
391 $do21 = no -a $do22 = no -a $do23 = no -a $do24 = no -a \
392 $do25 = no -a $do26 = no ] ; then
393 do1=yes
394 do2=yes
395 do3=yes
396 do4=yes
397 do5=yes
398 do6=yes
399 do7=yes
400 do8=yes
401 do9=yes
402 do10=yes
403 do11=yes
404 do12=yes
405 do13=yes
406 do14=yes
407 do15=yes
408 do16=yes
409 do17=yes
410 do18=yes
411 do19=yes
412 do20=yes
413 do21=yes
414 do22=yes
415 do23=yes
416 do24=yes
417 do25=yes
418 do26=yes
419 fi
420
421 # Extra test round for testing 32-bit UTF mode with high bits set
422 if test "$test32" != "skip" -a $utf -eq 1; then
423 test32plus="-32+"
424 else
425 test32plus=skip
426 fi
427
428 # Show which release and which test data
429
430 echo ""
431 echo PCRE C library tests using test data from $testdata
432 $sim ./pcretest /dev/null
433
434 for bmode in "$test8" "$test16" "$test32" "$test32plus"; do
435 case "$bmode" in
436 skip) continue;;
437 -16) if [ "$test8$test32" != "skipskip" ] ; then echo ""; fi
438 bits=16; echo "---- Testing 16-bit library ----"; echo "";;
439 -32) if [ "$test8$test16" != "skipskip" ] ; then echo ""; fi
440 bits=32; echo "---- Testing 32-bit library ----"; echo "";;
441 -32+) echo ""
442 bits=32; echo "---- Testing 32-bit library UTF-32 mode with high bits set ----"; echo "";;
443 *) bits=8; echo "---- Testing 8-bit library ----"; echo "";;
444 esac
445
446 # When testing 32-bit UTF mode with high bits masked, skip all non-UTF tests
447 # Since this is the last test, we can just set doN=no
448 if test "$bmode" = "-32+"; then
449 do1=no do2=no do3=no do8=no
450 do12=no do13=no do14=no do15=no do16=no do17=no
451 do20=no do21=no do23=no do24=no do25=no
452 fi
453
454 # Primary test, compatible with JIT and all versions of Perl >= 5.8
455
456 if [ $do1 = yes ] ; then
457 echo $title1
458 for opt in "" "-s" $jitopt; do
459 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
460 if [ $? = 0 ] ; then
461 $cf $testdata/testoutput1 testtry
462 if [ $? != 0 ] ; then exit 1; fi
463 else exit 1
464 fi
465 if [ "$opt" = "-s" ] ; then echo " OK with study"
466 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
467 else echo " OK"
468 fi
469 done
470 fi
471
472 # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
473
474 if [ $do2 = yes ] ; then
475 echo $title2 "(not UTF-$bits)"
476 for opt in "" "-s" $jitopt; do
477 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
478 if [ $? = 0 ] ; then
479 $cf $testdata/testoutput2 testtry
480 if [ $? != 0 ] ; then exit 1; fi
481 else
482 echo " "
483 echo "** Test 2 requires a lot of stack. If it has crashed with a"
484 echo "** segmentation fault, it may be that you do not have enough"
485 echo "** stack available by default. Please see the 'pcrestack' man"
486 echo "** page for a discussion of PCRE's stack usage."
487 echo " "
488 exit 1
489 fi
490 if [ "$opt" = "-s" ] ; then echo " OK with study"
491 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
492 else echo " OK"
493 fi
494 done
495 fi
496
497 # Locale-specific tests, provided that either the "fr_FR" or the "french"
498 # locale is available. The former is the Unix-like standard; the latter is
499 # for Windows. Another possibility is "fr", which needs to be run against
500 # the Windows-specific input and output files.
501
502 if [ $do3 = yes ] ; then
503 locale -a | grep '^fr_FR$' >/dev/null
504 if [ $? -eq 0 ] ; then
505 locale=fr_FR
506 infile=$testdata/testinput3
507 outfile=$testdata/testoutput3
508 else
509 infile=test3input
510 outfile=test3output
511 locale -a | grep '^french$' >/dev/null
512 if [ $? -eq 0 ] ; then
513 locale=french
514 sed 's/fr_FR/french/' $testdata/testinput3 >test3input
515 sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
516 else
517 locale -a | grep '^fr$' >/dev/null
518 if [ $? -eq 0 ] ; then
519 locale=fr
520 sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
521 sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
522 else
523 locale=
524 fi
525 fi
526 fi
527
528 if [ "$locale" != "" ] ; then
529 echo $title3 "(using '$locale' locale)"
530 for opt in "" "-s" $jitopt; do
531 $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
532 if [ $? = 0 ] ; then
533 $cf $outfile testtry
534 if [ $? != 0 ] ; then
535 echo " "
536 echo "Locale test did not run entirely successfully."
537 echo "This usually means that there is a problem with the locale"
538 echo "settings rather than a bug in PCRE."
539 break;
540 else
541 if [ "$opt" = "-s" ] ; then echo " OK with study"
542 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
543 else echo " OK"
544 fi
545 fi
546 else exit 1
547 fi
548 done
549 else
550 echo "Cannot test locale-specific features - none of the 'fr_FR', 'fr' or"
551 echo "'french' locales exist, or the \"locale\" command is not available"
552 echo "to check for them."
553 echo " "
554 fi
555 fi
556
557 # Additional tests for UTF support
558
559 if [ $do4 = yes ] ; then
560 echo ${title4A}-${bits}${title4B}
561 if [ $utf -eq 0 ] ; then
562 echo " Skipped because UTF-$bits support is not available"
563 else
564 for opt in "" "-s" $jitopt; do
565 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
566 if [ $? = 0 ] ; then
567 $cf $testdata/testoutput4 testtry
568 if [ $? != 0 ] ; then exit 1; fi
569 else exit 1
570 fi
571 if [ "$opt" = "-s" ] ; then echo " OK with study"
572 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
573 else echo " OK"
574 fi
575 done
576 fi
577 fi
578
579 if [ $do5 = yes ] ; then
580 echo ${title5}-${bits} support
581 if [ $utf -eq 0 ] ; then
582 echo " Skipped because UTF-$bits support is not available"
583 else
584 for opt in "" "-s" $jitopt; do
585 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
586 if [ $? = 0 ] ; then
587 $cf $testdata/testoutput5 testtry
588 if [ $? != 0 ] ; then exit 1; fi
589 else exit 1
590 fi
591 if [ "$opt" = "-s" ] ; then echo " OK with study"
592 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
593 else echo " OK"
594 fi
595 done
596 fi
597 fi
598
599 if [ $do6 = yes ] ; then
600 echo $title6
601 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
602 echo " Skipped because Unicode property support is not available"
603 else
604 for opt in "" "-s" $jitopt; do
605 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
606 if [ $? = 0 ] ; then
607 $cf $testdata/testoutput6 testtry
608 if [ $? != 0 ] ; then exit 1; fi
609 else exit 1
610 fi
611 if [ "$opt" = "-s" ] ; then echo " OK with study"
612 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
613 else echo " OK"
614 fi
615 done
616 fi
617 fi
618
619 # Test non-Perl-compatible Unicode property support
620
621 if [ $do7 = yes ] ; then
622 echo $title7
623 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
624 echo " Skipped because Unicode property support is not available"
625 else
626 for opt in "" "-s" $jitopt; do
627 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
628 if [ $? = 0 ] ; then
629 $cf $testdata/testoutput7 testtry
630 if [ $? != 0 ] ; then exit 1; fi
631 else exit 1
632 fi
633 if [ "$opt" = "-s" ] ; then echo " OK with study"
634 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
635 else echo " OK"
636 fi
637 done
638 fi
639 fi
640
641 # Tests for DFA matching support
642
643 if [ $do8 = yes ] ; then
644 echo $title8
645 for opt in "" "-s"; do
646 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
647 if [ $? = 0 ] ; then
648 $cf $testdata/testoutput8 testtry
649 if [ $? != 0 ] ; then exit 1; fi
650 else exit 1
651 fi
652 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
653 done
654 fi
655
656 if [ $do9 = yes ] ; then
657 echo ${title9}-${bits}
658 if [ $utf -eq 0 ] ; then
659 echo " Skipped because UTF-$bits support is not available"
660 else
661 for opt in "" "-s"; do
662 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput9 testtry
663 if [ $? = 0 ] ; then
664 $cf $testdata/testoutput9 testtry
665 if [ $? != 0 ] ; then exit 1; fi
666 else exit 1
667 fi
668 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
669 done
670 fi
671 fi
672
673 if [ $do10 = yes ] ; then
674 echo $title10
675 if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
676 echo " Skipped because Unicode property support is not available"
677 else
678 for opt in "" "-s"; do
679 $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput10 testtry
680 if [ $? = 0 ] ; then
681 $cf $testdata/testoutput10 testtry
682 if [ $? != 0 ] ; then exit 1; fi
683 else exit 1
684 fi
685 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
686 done
687 fi
688 fi
689
690 # Test of internal offsets and code sizes. This test is run only when there
691 # is Unicode property support and the link size is 2. The actual tests are
692 # mostly the same as in some of the above, but in this test we inspect some
693 # offsets and sizes that require a known link size. This is a doublecheck for
694 # the maintainer, just in case something changes unexpectely. The output from
695 # this test is not the same in 8-bit and 16-bit modes.
696
697 if [ $do11 = yes ] ; then
698 echo $title11
699 if [ $link_size -ne 2 ] ; then
700 echo " Skipped because link size is not 2"
701 elif [ $ucp -eq 0 ] ; then
702 echo " Skipped because Unicode property support is not available"
703 else
704 for opt in "" "-s"; do
705 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput11 testtry
706 if [ $? = 0 ] ; then
707 $cf $testdata/testoutput11-$bits testtry
708 if [ $? != 0 ] ; then exit 1; fi
709 else exit 1
710 fi
711 if [ "$opt" = "-s" ] ; then echo " OK with study" ; else echo " OK"; fi
712 done
713 fi
714 fi
715
716 # Test JIT-specific features when JIT is available
717
718 if [ $do12 = yes ] ; then
719 echo $title12
720 if [ $jit -eq 0 ] ; then
721 echo " Skipped because JIT is not available or not usable"
722 else
723 $sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
724 if [ $? = 0 ] ; then
725 $cf $testdata/testoutput12 testtry
726 if [ $? != 0 ] ; then exit 1; fi
727 else exit 1
728 fi
729 echo " OK"
730 fi
731 fi
732
733 # Test JIT-specific features when JIT is not available
734
735 if [ $do13 = yes ] ; then
736 echo $title13
737 if [ $jit -ne 0 ] ; then
738 echo " Skipped because JIT is available"
739 else
740 $sim $valgrind ./pcretest -q $bmode $testdata/testinput13 testtry
741 if [ $? = 0 ] ; then
742 $cf $testdata/testoutput13 testtry
743 if [ $? != 0 ] ; then exit 1; fi
744 else exit 1
745 fi
746 echo " OK"
747 fi
748 fi
749
750 # Tests for 8-bit-specific features
751
752 if [ "$do14" = yes ] ; then
753 echo $title14
754 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
755 echo " Skipped when running 16/32-bit tests"
756 else
757 cp -f $testdata/saved16 testsaved16
758 cp -f $testdata/saved32 testsaved32
759 for opt in "" "-s" $jitopt; do
760 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
761 if [ $? = 0 ] ; then
762 $cf $testdata/testoutput14 testtry
763 if [ $? != 0 ] ; then exit 1; fi
764 else exit 1
765 fi
766 if [ "$opt" = "-s" ] ; then echo " OK with study"
767 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
768 else echo " OK"
769 fi
770 done
771 fi
772 fi
773
774 # Tests for 8-bit-specific features (needs UTF-8 support)
775
776 if [ "$do15" = yes ] ; then
777 echo $title15
778 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
779 echo " Skipped when running 16/32-bit tests"
780 elif [ $utf -eq 0 ] ; then
781 echo " Skipped because UTF-$bits support is not available"
782 else
783 for opt in "" "-s" $jitopt; do
784 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
785 if [ $? = 0 ] ; then
786 $cf $testdata/testoutput15 testtry
787 if [ $? != 0 ] ; then exit 1; fi
788 else exit 1
789 fi
790 if [ "$opt" = "-s" ] ; then echo " OK with study"
791 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
792 else echo " OK"
793 fi
794 done
795 fi
796 fi
797
798 # Tests for 8-bit-specific features (Unicode property support)
799
800 if [ $do16 = yes ] ; then
801 echo $title16
802 if [ "$bits" = "16" -o "$bits" = "32" ] ; then
803 echo " Skipped when running 16/32-bit tests"
804 elif [ $ucp -eq 0 ] ; then
805 echo " Skipped because Unicode property support is not available"
806 else
807 for opt in "" "-s" $jitopt; do
808 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
809 if [ $? = 0 ] ; then
810 $cf $testdata/testoutput16 testtry
811 if [ $? != 0 ] ; then exit 1; fi
812 else exit 1
813 fi
814 if [ "$opt" = "-s" ] ; then echo " OK with study"
815 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
816 else echo " OK"
817 fi
818 done
819 fi
820 fi
821
822 # Tests for 16/32-bit-specific features
823
824 if [ $do17 = yes ] ; then
825 echo $title17
826 if [ "$bits" = "8" ] ; then
827 echo " Skipped when running 8-bit tests"
828 else
829 for opt in "" "-s" $jitopt; do
830 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
831 if [ $? = 0 ] ; then
832 $cf $testdata/testoutput17 testtry
833 if [ $? != 0 ] ; then exit 1; fi
834 else exit 1
835 fi
836 if [ "$opt" = "-s" ] ; then echo " OK with study"
837 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
838 else echo " OK"
839 fi
840 done
841 fi
842 fi
843
844 # Tests for 16/32-bit-specific features (UTF-16/32 support)
845
846 if [ $do18 = yes ] ; then
847 echo $title18
848 if [ "$bits" = "8" ] ; then
849 echo " Skipped when running 8-bit tests"
850 elif [ $utf -eq 0 ] ; then
851 echo " Skipped because UTF-$bits support is not available"
852 else
853 for opt in "" "-s" $jitopt; do
854 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
855 if [ $? = 0 ] ; then
856 $cf $testdata/testoutput18-$bits testtry
857 if [ $? != 0 ] ; then exit 1; fi
858 else exit 1
859 fi
860 if [ "$opt" = "-s" ] ; then echo " OK with study"
861 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
862 else echo " OK"
863 fi
864 done
865 fi
866 fi
867
868 # Tests for 16/32-bit-specific features (Unicode property support)
869
870 if [ $do19 = yes ] ; then
871 echo $title19
872 if [ "$bits" = "8" ] ; then
873 echo " Skipped when running 8-bit tests"
874 elif [ $ucp -eq 0 ] ; then
875 echo " Skipped because Unicode property support is not available"
876 else
877 for opt in "" "-s" $jitopt; do
878 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
879 if [ $? = 0 ] ; then
880 $cf $testdata/testoutput19 testtry
881 if [ $? != 0 ] ; then exit 1; fi
882 else exit 1
883 fi
884 if [ "$opt" = "-s" ] ; then echo " OK with study"
885 elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
886 else echo " OK"
887 fi
888 done
889 fi
890 fi
891
892 # Tests for 16/32-bit-specific features in DFA non-UTF-16 mode
893
894 if [ $do20 = yes ] ; then
895 echo $title20
896 if [ "$bits" = "8" ] ; then
897 echo " Skipped when running 8-bit tests"
898 else
899 for opt in "" "-s"; do
900 $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput20 testtry
901 if [ $? = 0 ] ; then
902 $cf $testdata/testoutput20 testtry
903 if [ $? != 0 ] ; then exit 1; fi
904 else exit 1
905 fi
906 if [ "$opt" = "-s" ] ; then echo " OK with study"
907 else echo " OK"
908 fi
909 done
910 fi
911 fi
912
913 # Tests for reloads with 16/32-bit library
914
915 if [ $do21 = yes ] ; then
916 echo $title21
917 if [ "$bits" = "8" ] ; then
918 echo " Skipped when running 8-bit tests"
919 elif [ $link_size -ne 2 ] ; then
920 echo " Skipped because link size is not 2"
921 else
922 cp -f $testdata/saved8 testsaved8
923 cp -f $testdata/saved16LE-1 testsaved16LE-1
924 cp -f $testdata/saved16BE-1 testsaved16BE-1
925 cp -f $testdata/saved32LE-1 testsaved32LE-1
926 cp -f $testdata/saved32BE-1 testsaved32BE-1
927 $sim $valgrind ./pcretest -q $bmode $testdata/testinput21 testtry
928 if [ $? = 0 ] ; then
929 $cf $testdata/testoutput21-$bits testtry
930 if [ $? != 0 ] ; then exit 1; fi
931 else exit 1
932 fi
933 echo " OK"
934 fi
935 fi
936
937 # Tests for reloads with 16/32-bit library (UTF-16 support)
938
939 if [ $do22 = yes ] ; then
940 echo $title22
941 if [ "$bits" = "8" ] ; then
942 echo " Skipped when running 8-bit tests"
943 elif [ $utf -eq 0 ] ; then
944 echo " Skipped because UTF-$bits support is not available"
945 elif [ $link_size -ne 2 ] ; then
946 echo " Skipped because link size is not 2"
947 else
948 cp -f $testdata/saved16LE-2 testsaved16LE-2
949 cp -f $testdata/saved16BE-2 testsaved16BE-2
950 cp -f $testdata/saved32LE-2 testsaved32LE-2
951 cp -f $testdata/saved32BE-2 testsaved32BE-2
952 $sim $valgrind ./pcretest -q $bmode $testdata/testinput22 testtry
953 if [ $? = 0 ] ; then
954 $cf $testdata/testoutput22-$bits testtry
955 if [ $? != 0 ] ; then exit 1; fi
956 else exit 1
957 fi
958 echo " OK"
959 fi
960 fi
961
962 if [ $do23 = yes ] ; then
963 echo $title23
964 if [ "$bits" = "8" -o "$bits" = "32" ] ; then
965 echo " Skipped when running 8/32-bit tests"
966 else
967 $sim $valgrind ./pcretest -q $bmode $testdata/testinput23 testtry
968 if [ $? = 0 ] ; then
969 $cf $testdata/testoutput23 testtry
970 if [ $? != 0 ] ; then exit 1; fi
971 else exit 1
972 fi
973 echo " OK"
974 fi
975 fi
976
977 if [ $do24 = yes ] ; then
978 echo $title24
979 if [ "$bits" = "8" -o "$bits" = "32" ] ; then
980 echo " Skipped when running 8/32-bit tests"
981 elif [ $utf -eq 0 ] ; then
982 echo " Skipped because UTF-$bits support is not available"
983 else
984 $sim $valgrind ./pcretest -q $bmode $testdata/testinput24 testtry
985 if [ $? = 0 ] ; then
986 $cf $testdata/testoutput24 testtry
987 if [ $? != 0 ] ; then exit 1; fi
988 else exit 1
989 fi
990 echo " OK"
991 fi
992 fi
993
994 if [ $do25 = yes ] ; then
995 echo $title25
996 if [ "$bits" = "8" -o "$bits" = "16" ] ; then
997 echo " Skipped when running 8/16-bit tests"
998 else
999 $sim $valgrind ./pcretest -q $bmode $testdata/testinput25 testtry
1000 if [ $? = 0 ] ; then
1001 $cf $testdata/testoutput25 testtry
1002 if [ $? != 0 ] ; then exit 1; fi
1003 else exit 1
1004 fi
1005 echo " OK"
1006 fi
1007 fi
1008
1009 if [ $do26 = yes ] ; then
1010 echo $title26
1011 if [ "$bits" = "8" -o "$bits" = "16" ] ; then
1012 echo " Skipped when running 8/16-bit tests"
1013 elif [ $utf -eq 0 ] ; then
1014 echo " Skipped because UTF-$bits support is not available"
1015 else
1016 $sim $valgrind ./pcretest -q $bmode $testdata/testinput26 testtry
1017 if [ $? = 0 ] ; then
1018 $cf $testdata/testoutput26 testtry
1019 if [ $? != 0 ] ; then exit 1; fi
1020 else exit 1
1021 fi
1022 echo " OK"
1023 fi
1024 fi
1025
1026 # End of loop for 8/16/32-bit tests
1027 done
1028
1029 # Clean up local working files
1030 rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
1031
1032 # End

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5