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

Contents of /code/trunk/RunTest.in

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12