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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 128 - (hide annotations) (download)
Tue Mar 20 11:46:50 2007 UTC (7 years, 7 months ago) by ph10
Original Path: code/trunk/RunTest.in
File size: 6432 byte(s)
Make the use of dftables optional, and not the default. Further tidies to 
documentation.

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