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

Contents of /code/trunk/maint/ManyConfigTests

Parent Directory Parent Directory | Revision Log Revision Log


Revision 899 - (show annotations) (download)
Fri Jan 20 14:25:56 2012 UTC (2 years, 9 months ago) by ph10
File size: 6712 byte(s)
Typo!

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 do
173 runtest
174 done
175
176 # Now re-run some of the tests under valgrind.
177
178 echo "Tests in the current directory using valgrind"
179 valgrind=valgrind
180 cvalgrind="valgrind -q --smc-check=all"
181 withvalgrind="with valgrind"
182
183 for opts in \
184 "--enable-unicode-properties --disable-stack-for-recursion --disable-shared" \
185 "--enable-unicode-properties --with-link-size=3 --disable-shared" \
186 "--enable-jit --enable-unicode-properties --disable-shared" \
187 "--enable-pcre16 --enable-jit --enable-unicode-properties --disable-shared"
188 do
189 runtest
190 done
191
192 valgrind=
193 cvalgrind=
194 withvalgrind=
195
196 # Clean up the distribution and then do at least one build and test in a
197 # directory other than the source directory. It doesn't work unless the
198 # source directory is cleaned up first.
199
200 if [ -f Makefile ]; then
201 echo "Running 'make distclean'"
202 make distclean >/dev/null 2>&1
203 if [ $? -ne 0 ]; then
204 echo "** 'make distclean' failed"
205 exit 1
206 fi
207 fi
208
209 echo "Tests in the $tmp directory"
210 srcdir=`pwd`
211 export srcdir
212
213 if [ ! -e $tmp ]; then
214 mkdir $tmp
215 fi
216
217 if [ ! -d $tmp ]; then
218 echo "** Failed to create $tmp or it is not a directory"
219 exit 1
220 fi
221
222 cd $tmp
223 if [ $? -ne 0 ]; then
224 echo "** Failed to cd to $tmp"
225 exit 1
226 fi
227
228 for opts in \
229 "--enable-unicode-properties --disable-shared"
230 do
231 runtest
232 done
233
234 echo "Removing $tmp"
235
236 rm -rf $tmp
237
238 echo "All done"
239
240 # End

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12