/[pcre]/code/trunk/maint/ManyConfigTests
ViewVC logotype

Contents of /code/trunk/maint/ManyConfigTests

Parent Directory Parent Directory | Revision Log Revision Log


Revision 836 - (show annotations) (download)
Wed Dec 28 17:16:11 2011 UTC (2 years, 9 months ago) by ph10
File size: 6712 byte(s)
Merging all the changes from the pcre16 branch into the trunk.

1 #! /bin/sh
2
3 # This is a script for the use of PCRE maintainers. It configures and rebuilds
4 # PCRE with a variety of configuration options, and in each case runs the tests
5 # to ensure that all goes well. Every possible combination would take far too
6 # long, so we use a representative sample. This script should be run in the
7 # PCRE source directory.
8
9 # Some of the tests have to be skipped when PCRE is built with non-Unix newline
10 # recognition. I am planning to reduce this as much as possible in due course.
11
12
13 # This is in case the caller has set aliases (as I do - PH)
14
15 unset cp ls mv rm
16
17 # Use -v to make the output more verbose
18
19 verbose=0
20 if [ "$1" = "-v" ] ; then verbose=1; fi
21
22 # This is a temporary directory for testing out-of-line builds
23
24 tmp=/tmp/pcretesting
25
26
27 # This function runs a single test with the set of configuration options that
28 # are in $opts. The source directory must be set in srcdir.
29
30 function runtest()
31 {
32 rm -f *_unittest
33
34 if [ "$opts" = "" ] ; then
35 echo "Configuring with: default settings"
36 else
37 olen=`expr length "$opts"`
38 if [ $olen -gt 53 ] ; then
39 echo "Configuring with:"
40 echo " $opts"
41 else
42 echo "Configuring with: $opts"
43 fi
44 fi
45
46 $srcdir/configure $opts >/dev/null 2>teststderr
47 if [ $? -ne 0 ]; then
48 echo " "
49 echo "**** Error while configuring ****"
50 cat teststderr
51 exit 1
52 fi
53
54 echo "Making"
55 make >/dev/null 2>teststderr
56 if [ $? -ne 0 ]; then
57 echo " "
58 echo "**** Error while making ****"
59 cat teststderr
60 exit 1
61 fi
62
63 if [ $verbose -eq 1 ]; then
64 ./pcretest -C
65 fi
66
67 conf=`./pcretest -C`
68 nl=`expr match "$conf" ".*Newline sequence is \([A-Z]*\)"`
69 jit=`expr match "$conf" ".*[^o] Just-in-time"`
70 utf8=`expr match "$conf" ".*[^o] UTF-8 support"`
71
72 if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
73 echo "Running C library tests $withvalgrind"
74 $srcdir/RunTest $valgrind >teststdout
75 if [ $? -ne 0 ]; then
76 echo " "
77 echo "**** Test failed ****"
78 cat teststdout
79 exit 1
80 fi
81 else
82 echo "Skipping C library tests: newline is $nl"
83 fi
84
85 if [ "$nl" = "LF" ]; then
86 echo "Running pcregrep tests $withvalgrind"
87 $srcdir/RunGrepTest $valgrind >teststdout 2>teststderr
88 if [ $? -ne 0 ]; then
89 echo " "
90 echo "**** Test failed ****"
91 cat teststderr
92 cat teststdout
93 exit 1
94 fi
95 else
96 echo "Skipping pcregrep tests: newline is $nl"
97 fi
98
99 if [ "$jit" -gt 0 -a $utf8 -gt 0 ]; then
100 echo "Running JIT regression tests $withvalgrind"
101 $cvalgrind $srcdir/pcre_jit_test >teststdout 2>teststderr
102 if [ $? -ne 0 ]; then
103 echo " "
104 echo "**** Test failed ****"
105 cat teststderr
106 cat teststdout
107 exit 1
108 fi
109 else
110 echo "Skipping JIT regression tests: JIT or UTF-8 not enabled"
111 fi
112
113 if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
114 if [ -f pcrecpp_unittest ] ; then
115 for utest in pcrecpp_unittest \
116 pcre_scanner_unittest \
117 pcre_stringpiece_unittest
118 do
119 echo "Running $utest $withvalgrind"
120 $cvalgrind $utest >teststdout
121 if [ $? -ne 0 ]; then
122 echo " "
123 echo "**** Test failed ****"
124 cat teststdout
125 exit 1
126 fi
127 done
128 else
129 echo "Skipping C++ tests: pcrecpp_unittest does not exist"
130 fi
131 else
132 echo "Skipping C++ tests: newline is $nl"
133 fi
134 }
135
136
137 # This set of tests builds PCRE and runs the tests with a variety of configure
138 # options, in the current (source) directory. The first (empty) configuration
139 # builds with all the default settings. As well as testing that these options
140 # work, we use --disable-shared or --disable-static after the first test (which
141 # builds both) to save a bit of time by building only one version of the
142 # library for the subsequent tests.
143
144 valgrind=
145 cvalgrind=
146 withvalgrind=
147
148 echo "Tests in the current directory"
149 srcdir=.
150 for opts in \
151 "" \
152 "--enable-utf8 --disable-static" \
153 "--disable-stack-for-recursion --disable-shared" \
154 "--enable-utf8 --disable-stack-for-recursion --disable-shared" \
155 "--enable-unicode-properties --disable-shared" \
156 "--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
157 "--enable-unicode-properties --disable-cpp --with-link-size=3 --disable-shared" \
158 "--enable-rebuild-chartables --disable-shared" \
159 "--enable-newline-is-any --disable-shared" \
160 "--enable-newline-is-cr --disable-shared" \
161 "--enable-newline-is-crlf --disable-shared" \
162 "--enable-newline-is-anycrlf --enable-bsr-anycrlf --disable-shared" \
163 "--enable-utf8 --enable-newline-is-any --enable-unicode-properties --disable-stack-for-recursion --disable-static --disable-cpp" \
164 "--enable-jit --disable-shared" \
165 "--enable-jit --enable-unicode-properties --disable-shared" \
166 "--enable-jit --enable-unicode-properties --with-link-size=3 --disable-shared" \
167 "--enable-pcre16" \
168 "--enable-pcre16 --enable-jit --enable-utf --disable-shared" \
169 "--enable-pcre16 --enable-jit --enable-unicode-properties --disable-shared" \
170 "--enable-pcre16 --enable-jit --disable-pcre8 --disable-shared" \
171 "--enable-pcre16 --enable-jit --disable-pcre8 --enable-utf --disable-shared" \
172 "--enable-pcre16 --disable-stack-for-recursion --disable-shared" \
173 "--enable-pcre16 --enable-unicode-properties --disable-stack-for-recursion --disable-shared"
174 do
175 runtest
176 done
177
178 # Now re-run some of the tests under valgrind.
179
180 echo "Tests in the current directory using valgrind"
181 valgrind=valgrind
182 cvalgrind="valgrind -q --smc-check=all"
183 withvalgrind="with valgrind"
184
185 for opts in \
186 "--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
187 "--enable-unicode-properties --with-link-size=3 --disable-shared" \
188 "--enable-jit --enable-unicode-properties --disable-shared" \
189 "--enable-pcre16 --enable-jit --enable-unicode-properties --disable-shared"
190 do
191 runtest
192 done
193
194 valgrind=
195 cvalgrind=
196 withvalgrind=
197
198 # Clean up the distribution and then do at least one build and test in a
199 # directory other than the source directory. It doesn't work unless the
200 # source directory is cleaned up first.
201
202 if [ -f Makefile ]; then
203 echo "Running 'make distclean'"
204 make distclean >/dev/null 2>&1
205 if [ $? -ne 0 ]; then
206 echo "** 'make distclean' failed"
207 exit 1
208 fi
209 fi
210
211 echo "Tests in the $tmp directory"
212 srcdir=`pwd`
213 export srcdir
214
215 if [ ! -e $tmp ]; then
216 mkdir $tmp
217 fi
218
219 if [ ! -d $tmp ]; then
220 echo "** Failed to create $tmp or it is not a directory"
221 exit 1
222 fi
223
224 cd $tmp
225 if [ $? -ne 0 ]; then
226 echo "** Failed to cd to $tmp"
227 exit 1
228 fi
229
230 for opts in \
231 "--enable-unicode-properties --disable-shared"
232 do
233 runtest
234 done
235
236 echo "Removing $tmp"
237
238 rm -rf $tmp
239
240 echo "All done"
241
242 # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12