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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (hide annotations) (download)
Sat Feb 24 21:40:59 2007 UTC (7 years, 5 months ago) by nigel
Original Path: code/trunk/RunTest.in
File size: 5996 byte(s)
Load pcre-6.2 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 81 if [ ! -d testdata ] ; then
10     ln -s @top_srcdir@/testdata testdata
11     fi
12     testdata=./testdata
13 nigel 49
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 nigel 75 do6=no
22 nigel 77 do7=no
23     do8=no
24     do9=no
25 nigel 49
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 nigel 77 5) do5=yes;;
33     6) do6=yes;;
34     7) do7=yes;;
35     8) do8=yes;;
36     9) do9=yes;;
37 nigel 49 *) echo "Unknown test number $1"; exit 1;;
38     esac
39     shift
40     done
41    
42 nigel 75 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 nigel 77 exit 1
46     fi
47 nigel 75 if [ $do5 = yes ] ; then
48     echo "Can't run test 5 with an internal link size other than 2"
49 nigel 77 exit 1
50     fi
51 nigel 75 if [ $do6 = yes ] ; then
52     echo "Can't run test 6 with an internal link size other than 2"
53 nigel 77 exit 1
54     fi
55 nigel 75 fi
56    
57 nigel 49 if [ "@UTF8@" = "" ] ; then
58 nigel 63 if [ $do4 = yes ] ; then
59 nigel 75 echo "Can't run test 4 because UTF-8 support is not configured"
60 nigel 63 exit 1
61 nigel 77 fi
62 nigel 49 if [ $do5 = yes ] ; then
63 nigel 75 echo "Can't run test 5 because UTF-8 support is not configured"
64 nigel 49 exit 1
65 nigel 77 fi
66 nigel 75 if [ $do6 = yes ] ; then
67     echo "Can't run test 6 because UTF-8 support is not configured"
68     exit 1
69 nigel 77 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 nigel 49
80 nigel 75 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 nigel 77 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 nigel 75
91     if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
92 nigel 77 $do5 = no -a $do6 = no -a $do7 = no -a $do8 = no -a \
93     $do9 = no ] ; then
94 nigel 49 do1=yes
95 nigel 77 do2=yes
96 nigel 49 do3=yes
97 nigel 63 if [ "@UTF8@" != "" ] ; then do4=yes; fi
98 nigel 49 if [ "@UTF8@" != "" ] ; then do5=yes; fi
99 nigel 75 if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do6=yes; fi
100 nigel 77 do7=yes
101     if [ "@UTF8@" != "" ] ; then do8=yes; fi
102     if [ "@UTF8@" != "" -a "@UCP@" != "" ] ; then do9=yes; fi
103 nigel 49 fi
104    
105 nigel 73 # Show which release
106    
107     ./pcretest /dev/null
108    
109 nigel 49 # Primary test, Perl-compatible
110    
111     if [ $do1 = yes ] ; then
112 nigel 75 echo "Test 1: main functionality (Perl compatible)"
113 nigel 53 ./pcretest $testdata/testinput1 testtry
114 nigel 49 if [ $? = 0 ] ; then
115 nigel 53 $cf testtry $testdata/testoutput1
116 nigel 49 if [ $? != 0 ] ; then exit 1; fi
117     else exit 1
118     fi
119 nigel 77 echo "OK"
120     echo " "
121 nigel 49 fi
122    
123     # PCRE tests that are not Perl-compatible - API & error tests, mostly
124    
125     if [ $do2 = yes ] ; then
126 nigel 77 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
127 nigel 75 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 nigel 77 echo "OK"
135     echo " "
136 nigel 75 else
137 nigel 77 echo Test 2 skipped for link size other than 2 \(@LINK_SIZE@\)
138     echo " "
139     fi
140 nigel 49 fi
141    
142 nigel 73 # Locale-specific tests, provided the "fr_FR" locale is available
143 nigel 49
144 nigel 63 if [ $do3 = yes ] ; then
145 nigel 73 locale -a | grep '^fr_FR$' >/dev/null
146 nigel 49 if [ $? -eq 0 ] ; then
147 nigel 75 echo "Test 3: locale-specific features (using 'fr_FR' locale)"
148 nigel 63 ./pcretest $testdata/testinput3 testtry
149 nigel 49 if [ $? = 0 ] ; then
150 nigel 63 $cf testtry $testdata/testoutput3
151 nigel 77 if [ $? != 0 ] ; then
152 nigel 49 echo " "
153     echo "Locale test did not run entirely successfully."
154     echo "This usually means that there is a problem with the locale"
155 nigel 77 echo "settings rather than a bug in PCRE."
156 nigel 49 else
157 nigel 77 echo "OK"
158     fi
159     echo " "
160 nigel 49 else exit 1
161     fi
162     else
163 nigel 73 echo "Cannot test locale-specific features - 'fr_FR' locale not found,"
164 nigel 49 echo "or the \"locale\" command is not available to check for it."
165 nigel 77 echo " "
166 nigel 49 fi
167     fi
168    
169     # Additional tests for UTF8 support
170    
171 nigel 63 if [ $do4 = yes ] ; then
172 nigel 75 echo "Test 4: UTF-8 support (Perl compatible)"
173 nigel 77 ./pcretest $testdata/testinput4 testtry
174 nigel 49 if [ $? = 0 ] ; then
175 nigel 63 $cf testtry $testdata/testoutput4
176 nigel 49 if [ $? != 0 ] ; then exit 1; fi
177     else exit 1
178     fi
179 nigel 77 echo "OK"
180 nigel 49 echo " "
181     fi
182    
183 nigel 63 if [ $do5 = yes ] ; then
184 nigel 77 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
185 nigel 75 echo "Test 5: API and internals for UTF-8 support (not Perl compatible)"
186 nigel 77 ./pcretest $testdata/testinput5 testtry
187 nigel 75 if [ $? = 0 ] ; then
188     $cf testtry $testdata/testoutput5
189     if [ $? != 0 ] ; then exit 1; fi
190     else exit 1
191     fi
192 nigel 77 echo "OK"
193 nigel 75 echo " "
194     else
195 nigel 77 echo Test 5 skipped for link size other than 2 \(@LINK_SIZE@\)
196     echo " "
197     fi
198 nigel 49 fi
199    
200 nigel 75 if [ $do6 = yes ] ; then
201 nigel 77 if [ "@LINK_SIZE@" = "" -o "@LINK_SIZE@" = "-DLINK_SIZE=2" ] ; then
202 nigel 75 echo "Test 6: Unicode property support"
203 nigel 77 ./pcretest $testdata/testinput6 testtry
204 nigel 75 if [ $? = 0 ] ; then
205     $cf testtry $testdata/testoutput6
206     if [ $? != 0 ] ; then exit 1; fi
207     else exit 1
208     fi
209 nigel 77 echo "OK"
210 nigel 75 echo " "
211 nigel 77 else
212     echo Test 6 skipped for link size other than 2 \(@LINK_SIZE@\)
213     echo " "
214     fi
215 nigel 75 fi
216    
217 nigel 77 # 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 nigel 49 # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12