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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93 - (hide annotations) (download)
Sat Feb 24 21:41:42 2007 UTC (7 years, 9 months ago) by nigel
Original Path: code/trunk/RunTest.in
File size: 6161 byte(s)
Load pcre-7.0 into code/trunk.

1 nigel 49 #! /bin/sh
2    
3     # This file is generated by configure from RunTest.in. Make any changes
4     # to that file.
5    
6     # Run PCRE tests
7    
8     cf=diff
9 nigel 87 valgrind=
10 nigel 81 if [ ! -d testdata ] ; then
11     ln -s @top_srcdir@/testdata testdata
12     fi
13     testdata=./testdata
14 nigel 49
15 nigel 87
16 nigel 49 # Select which tests to run; if no selection, run all
17    
18     do1=no
19     do2=no
20     do3=no
21     do4=no
22     do5=no
23 nigel 75 do6=no
24 nigel 77 do7=no
25     do8=no
26     do9=no
27 nigel 49
28     while [ $# -gt 0 ] ; do
29     case $1 in
30     1) do1=yes;;
31     2) do2=yes;;
32     3) do3=yes;;
33     4) do4=yes;;
34 nigel 77 5) do5=yes;;
35     6) do6=yes;;
36     7) do7=yes;;
37     8) do8=yes;;
38     9) do9=yes;;
39 nigel 87 valgrind) valgrind="valgrind -q";;
40 nigel 49 *) echo "Unknown test number $1"; exit 1;;
41     esac
42     shift
43     done
44    
45 nigel 75 if [ "@LINK_SIZE@" != "" -a "@LINK_SIZE@" != "-DLINK_SIZE=2" ] ; then
46     if [ $do2 = yes ] ; then
47     echo "Can't run test 2 with an internal link size other than 2"
48 nigel 77 exit 1
49     fi
50 nigel 75 if [ $do5 = yes ] ; then
51     echo "Can't run test 5 with an internal link size other than 2"
52 nigel 77 exit 1
53     fi
54 nigel 75 if [ $do6 = yes ] ; then
55     echo "Can't run test 6 with an internal link size other than 2"
56 nigel 77 exit 1
57     fi
58 nigel 75 fi
59    
60 nigel 49 if [ "@UTF8@" = "" ] ; then
61 nigel 63 if [ $do4 = yes ] ; then
62 nigel 75 echo "Can't run test 4 because UTF-8 support is not configured"
63 nigel 63 exit 1
64 nigel 77 fi
65 nigel 49 if [ $do5 = yes ] ; then
66 nigel 75 echo "Can't run test 5 because UTF-8 support is not configured"
67 nigel 49 exit 1
68 nigel 77 fi
69 nigel 75 if [ $do6 = yes ] ; then
70     echo "Can't run test 6 because UTF-8 support is not configured"
71     exit 1
72 nigel 77 fi
73     if [ $do8 = yes ] ; then
74     echo "Can't run test 8 because UTF-8 support is not configured"
75     exit 1
76     fi
77     if [ $do9 = yes ] ; then
78     echo "Can't run test 9 because UTF-8 support is not configured"
79     exit 1
80     fi
81     fi
82 nigel 49
83 nigel 75 if [ "@UCP@" = "" ] ; then
84     if [ $do6 = yes ] ; then
85     echo "Can't run test 6 because Unicode property support is not configured"
86     exit 1
87     fi
88 nigel 77 if [ $do9 = yes ] ; then
89     echo "Can't run test 9 because Unicode property support is not configured"
90     exit 1
91     fi
92     fi
93 nigel 75
94     if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
95 nigel 77 $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
96     $do9 = no ] ; then
97 nigel 49 do1=yes
98 nigel 77 do2=yes
99 nigel 49 do3=yes
100 nigel 63 if [ "@UTF8@" != "" ] ; then do4=yes; fi
101 nigel 49 if [ "@UTF8@" != "" ] ; then do5=yes; fi
102 nigel 75 if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi
103 nigel 77 do7=yes
104     if [ "@UTF8@" != "" ] ; then do8=yes; fi
105     if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi
106 nigel 49 fi
107    
108 nigel 73 # Show which release
109    
110     ./pcretest /dev/null
111    
112 nigel 49 # Primary test, Perl-compatible
113    
114     if [ $do1 = yes ] ; then
115 nigel 75 echo "Test 1: main functionality (Perl compatible)"
116 nigel 87 $valgrind ./pcretest -q $testdata/testinput1 testtry
117 nigel 49 if [ $? = 0 ] ; then
118 nigel 53 $cf testtry $testdata/testoutput1
119 nigel 49 if [ $? != 0 ] ; then exit 1; fi
120     else exit 1
121     fi
122 nigel 77 echo "OK"
123     echo " "
124 nigel 49 fi
125    
126     # PCRE tests that are not Perl-compatible - API & error tests, mostly
127    
128     if [ $do2 = yes ] ; then
129 nigel 77 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
130 nigel 75 echo "Test 2: API and error handling (not Perl compatible)"
131 nigel 93 $valgrind ./pcretest -q $testdata/testinput2 testtry
132 nigel 75 if [ $? = 0 ] ; then
133     $cf testtry $testdata/testoutput2
134     if [ $? != 0 ] ; then exit 1; fi
135     else exit 1
136     fi
137 nigel 77 echo "OK"
138     echo " "
139 nigel 75 else
140 nigel 77 echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\)
141     echo " "
142     fi
143 nigel 49 fi
144    
145 nigel 73 # Locale-specific tests, provided the "fr_FR" locale is available
146 nigel 49
147 nigel 63 if [ $do3 = yes ] ; then
148 nigel 73 locale -a | grep '^fr_FR$' >/dev/null
149 nigel 49 if [ $? -eq 0 ] ; then
150 nigel 75 echo "Test 3: locale-specific features (using 'fr_FR' locale)"
151 nigel 87 $valgrind ./pcretest -q $testdata/testinput3 testtry
152 nigel 49 if [ $? = 0 ] ; then
153 nigel 63 $cf testtry $testdata/testoutput3
154 nigel 77 if [ $? != 0 ] ; then
155 nigel 49 echo " "
156     echo "Locale test did not run entirely successfully."
157     echo "This usually means that there is a problem with the locale"
158 nigel 77 echo "settings rather than a bug in PCRE."
159 nigel 49 else
160 nigel 77 echo "OK"
161     fi
162     echo " "
163 nigel 49 else exit 1
164     fi
165     else
166 nigel 73 echo "Cannot test locale-specific features - 'fr_FR' locale not found,"
167 nigel 49 echo "or the \"locale\" command is not available to check for it."
168 nigel 77 echo " "
169 nigel 49 fi
170     fi
171    
172     # Additional tests for UTF8 support
173    
174 nigel 63 if [ $do4 = yes ] ; then
175 nigel 75 echo "Test 4: UTF-8 support (Perl compatible)"
176 nigel 87 $valgrind ./pcretest -q $testdata/testinput4 testtry
177 nigel 49 if [ $? = 0 ] ; then
178 nigel 63 $cf testtry $testdata/testoutput4
179 nigel 49 if [ $? != 0 ] ; then exit 1; fi
180     else exit 1
181     fi
182 nigel 77 echo "OK"
183 nigel 49 echo " "
184     fi
185    
186 nigel 63 if [ $do5 = yes ] ; then
187 nigel 77 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
188 nigel 75 echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"
189 nigel 87 $valgrind ./pcretest -q $testdata/testinput5 testtry
190 nigel 75 if [ $? = 0 ] ; then
191     $cf testtry $testdata/testoutput5
192     if [ $? != 0 ] ; then exit 1; fi
193     else exit 1
194     fi
195 nigel 77 echo "OK"
196 nigel 75 echo " "
197     else
198 nigel 77 echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\)
199     echo " "
200     fi
201 nigel 49 fi
202    
203 nigel 75 if [ $do6 = yes ] ; then
204 nigel 77 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
205 nigel 75 echo "Test 6: Unicode property support"
206 nigel 87 $valgrind ./pcretest -q $testdata/testinput6 testtry
207 nigel 75 if [ $? = 0 ] ; then
208     $cf testtry $testdata/testoutput6
209     if [ $? != 0 ] ; then exit 1; fi
210     else exit 1
211     fi
212 nigel 77 echo "OK"
213 nigel 75 echo " "
214 nigel 77 else
215     echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\)
216     echo " "
217     fi
218 nigel 75 fi
219    
220 nigel 77 # Tests for DFA matching support
221    
222     if [ $do7 = yes ] ; then
223     echo "Test 7: DFA matching"
224 nigel 87 $valgrind ./pcretest -q -dfa $testdata/testinput7 testtry
225 nigel 77 if [ $? = 0 ] ; then
226     $cf testtry $testdata/testoutput7
227     if [ $? != 0 ] ; then exit 1; fi
228     else exit 1
229     fi
230     echo "OK"
231     echo " "
232     fi
233    
234     if [ $do8 = yes ] ; then
235     echo "Test 8: DFA matching with UTF-8"
236 nigel 87 $valgrind ./pcretest -q -dfa $testdata/testinput8 testtry
237 nigel 77 if [ $? = 0 ] ; then
238     $cf testtry $testdata/testoutput8
239     if [ $? != 0 ] ; then exit 1; fi
240     else exit 1
241     fi
242     echo "OK"
243     echo " "
244     fi
245    
246     if [ $do9 = yes ] ; then
247     echo "Test 9: DFA matching with Unicode properties"
248 nigel 87 $valgrind ./pcretest -q -dfa $testdata/testinput9 testtry
249 nigel 77 if [ $? = 0 ] ; then
250     $cf testtry $testdata/testoutput9
251     if [ $? != 0 ] ; then exit 1; fi
252     else exit 1
253     fi
254     echo "OK"
255     echo " "
256     fi
257    
258 nigel 49 # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12