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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.5