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

Contents of /code/trunk/maint/ManyConfigTests

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5