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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1459 - (hide annotations) (download)
Tue Mar 4 10:45:15 2014 UTC (7 weeks, 1 day ago) by ph10
File size: 29383 byte(s)
Preparations for next release.

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