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

Contents of /code/trunk/RunTest

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12