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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (show annotations) (download)
Sat Feb 24 21:40:59 2007 UTC (7 years, 4 months ago) by nigel
Original Path: code/trunk/RunTest.in
File size: 5996 byte(s)
Load pcre-6.2 into code/trunk.

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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12