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

Contents of /code/trunk/RunTest.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (hide annotations) (download)
Mon Mar 5 12:36:47 2007 UTC (7 years, 4 months ago) by ph10
File size: 6171 byte(s)
Applied Bob and Daniel's patches to convert the build system to automake. Added 
the maintain directory, containing files that are used for maintenance, but are 
not distributed. This is an intermediate step.

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