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

Contents of /code/trunk/maint/ManyConfigTests

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1169 - (show annotations)
Wed Oct 24 14:42:50 2012 UTC (6 years, 10 months ago) by ph10
File size: 7473 byte(s)
Add --enable-valgrind to the configuration of the tests that are run using 
valgrind.
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 echo "Configuring with:"
38 echo " $opts"
39 fi
40
41 $srcdir/configure $opts >/dev/null 2>teststderr
42 if [ $? -ne 0 ]; then
43 echo " "
44 echo "**** Error while configuring ****"
45 cat teststderr
46 exit 1
47 fi
48
49 echo "Making"
50 make >/dev/null 2>teststderr
51 if [ $? -ne 0 ]; then
52 echo " "
53 echo "**** Error while making ****"
54 cat teststderr
55 exit 1
56 fi
57
58 if [ $verbose -eq 1 ]; then
59 ./pcretest -C
60 fi
61
62 nl=`./pcretest -C newline`
63 ./pcretest -C jit >/dev/null
64 jit=$?
65 ./pcretest -C utf >/dev/null
66 utf=$?
67
68 if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
69 echo "Running C library tests $withvalgrind"
70 $srcdir/RunTest $valgrind >teststdout
71 if [ $? -ne 0 ]; then
72 echo " "
73 echo "**** Test failed ****"
74 cat teststdout
75 exit 1
76 fi
77 else
78 echo "Skipping C library tests: newline is $nl"
79 fi
80
81 if [ "$nl" = "LF" ]; then
82 echo "Running pcregrep tests $withvalgrind"
83 $srcdir/RunGrepTest $valgrind >teststdout 2>teststderr
84 if [ $? -ne 0 ]; then
85 echo " "
86 echo "**** Test failed ****"
87 cat teststderr
88 cat teststdout
89 exit 1
90 fi
91 else
92 echo "Skipping pcregrep tests: newline is $nl"
93 fi
94
95 if [ "$jit" -gt 0 -a $utf -gt 0 ]; then
96 echo "Running JIT regression tests $withvalgrind"
97 $cvalgrind $srcdir/pcre_jit_test >teststdout 2>teststderr
98 if [ $? -ne 0 ]; then
99 echo " "
100 echo "**** Test failed ****"
101 cat teststderr
102 cat teststdout
103 exit 1
104 fi
105 else
106 echo "Skipping JIT regression tests: JIT or UTF not enabled"
107 fi
108
109 if [ "$nl" = "LF" -o "$nl" = "ANY" ]; then
110 if [ -f pcrecpp_unittest ] ; then
111 for utest in pcrecpp_unittest \
112 pcre_scanner_unittest \
113 pcre_stringpiece_unittest
114 do
115 echo "Running $utest $withvalgrind"
116 $cvalgrind $utest >teststdout
117 if [ $? -ne 0 ]; then
118 echo " "
119 echo "**** Test failed ****"
120 cat teststdout
121 exit 1
122 fi
123 done
124 else
125 echo "Skipping C++ tests: pcrecpp_unittest does not exist"
126 fi
127 else
128 echo "Skipping C++ tests: newline is $nl"
129 fi
130 }
131
132
133 # This set of tests builds PCRE and runs the tests with a variety of configure
134 # options, in the current (source) directory. The first (empty) configuration
135 # builds with all the default settings. As well as testing that these options
136 # work, we use --disable-shared or --disable-static after the first test (which
137 # builds both) to save a bit of time by building only one version of the
138 # library for the subsequent tests.
139
140 valgrind=
141 cvalgrind=
142 withvalgrind=
143
144 echo "Tests in the current directory"
145 srcdir=.
146 for opts in \
147 "" \
148 "--enable-utf8 --disable-static" \
149 "--disable-stack-for-recursion --disable-shared" \
150 "--enable-utf8 --disable-stack-for-recursion --disable-shared" \
151 "--enable-unicode-properties --disable-shared" \
152 "--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
153 "--enable-unicode-properties --disable-cpp --with-link-size=3 --disable-shared" \
154 "--enable-rebuild-chartables --disable-shared" \
155 "--enable-newline-is-any --disable-shared" \
156 "--enable-newline-is-cr --disable-shared" \
157 "--enable-newline-is-crlf --disable-shared" \
158 "--enable-newline-is-anycrlf --enable-bsr-anycrlf --disable-shared" \
159 "--enable-utf8 --enable-newline-is-any --enable-unicode-properties --disable-stack-for-recursion --disable-static --disable-cpp" \
160 "--enable-jit --disable-shared" \
161 "--enable-jit --enable-unicode-properties --disable-shared" \
162 "--enable-jit --enable-unicode-properties --with-link-size=3 --disable-shared" \
163 "--enable-pcre16" \
164 "--enable-pcre16 --enable-jit --enable-utf --disable-shared" \
165 "--enable-pcre16 --enable-jit --enable-unicode-properties --disable-shared" \
166 "--enable-pcre16 --enable-jit --disable-pcre8 --disable-shared" \
167 "--enable-pcre16 --enable-jit --disable-pcre8 --enable-utf --disable-shared" \
168 "--enable-pcre16 --disable-stack-for-recursion --disable-shared" \
169 "--enable-pcre16 --enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
170 "--enable-pcre16 --enable-jit --enable-unicode-properties --with-link-size=3 --disable-shared" \
171 "--enable-pcre16 --enable-jit --enable-unicode-properties --with-link-size=4 --disable-shared"
172 "--enable-pcre32" \
173 "--enable-pcre32 --enable-jit --enable-utf --disable-shared" \
174 "--enable-pcre32 --enable-jit --enable-unicode-properties --disable-shared" \
175 "--enable-pcre32 --enable-jit --disable-pcre8 --disable-shared" \
176 "--enable-pcre32 --enable-jit --disable-pcre8 --enable-utf --disable-shared" \
177 "--enable-pcre32 --disable-stack-for-recursion --disable-shared" \
178 "--enable-pcre32 --enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
179 "--enable-pcre32 --enable-jit --enable-unicode-properties --with-link-size=4 --disable-shared" \
180 "--enable-pcre32 --enable-pcre16 --disable-shared" \
181 "--enable-pcre32 --enable-pcre16 --disable-pcre8 --disable-shared"
182 do
183 runtest
184 done
185
186 # Now re-run some of the tests under valgrind.
187
188 echo "Tests in the current directory using valgrind"
189 valgrind=valgrind
190 cvalgrind="valgrind -q --smc-check=all"
191 withvalgrind="with valgrind"
192
193 for opts in \
194 "--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
195 "--enable-unicode-properties --with-link-size=3 --disable-shared" \
196 "--enable-jit --enable-unicode-properties --disable-shared" \
197 "--enable-pcre16 --enable-pcre32 --enable-jit --enable-unicode-properties " \
198 "--disable-shared"
199 do
200 opts="--enable-valgrind $opts"
201 runtest
202 done
203
204 valgrind=
205 cvalgrind=
206 withvalgrind=
207
208 # Clean up the distribution and then do at least one build and test in a
209 # directory other than the source directory. It doesn't work unless the
210 # source directory is cleaned up first.
211
212 if [ -f Makefile ]; then
213 echo "Running 'make distclean'"
214 make distclean >/dev/null 2>&1
215 if [ $? -ne 0 ]; then
216 echo "** 'make distclean' failed"
217 exit 1
218 fi
219 fi
220
221 echo "Tests in the $tmp directory"
222 srcdir=`pwd`
223 export srcdir
224
225 if [ ! -e $tmp ]; then
226 mkdir $tmp
227 fi
228
229 if [ ! -d $tmp ]; then
230 echo "** Failed to create $tmp or it is not a directory"
231 exit 1
232 fi
233
234 cd $tmp
235 if [ $? -ne 0 ]; then
236 echo "** Failed to cd to $tmp"
237 exit 1
238 fi
239
240 for opts in \
241 "--enable-unicode-properties --disable-shared"
242 do
243 runtest
244 done
245
246 echo "Removing $tmp"
247
248 rm -rf $tmp
249
250 echo "All done"
251
252 # End

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5