Merge from mainline.
[official-gcc.git] / libjava / classpath / scripts / kissme-mauve
blob8a6ee22db66ae134794934affeeea8c18bd2ae0c
1 #!/bin/sh
3 CLASSPATH_CVS=~/mauve/classpath
4 CLASSPATH_PREFIX=~/mauve/root/classpath
5 MAUVE_CVS=~/mauve/mauve
6 KISSME_CVS=~/mauve/kissme
7 KISSME_PREFIX=~/mauve/root/kissme
8 KISSME_BIN=~/mauve/kissme/useful_scripts/kissme
9 LOG=/tmp/mauve.log
10 RESULTS=/tmp/kissme-mauve.txt
11 REPORT=/tmp/kissme-mauve-report.txt
12 TIMEOUT=30
14 rm -f ${LOG} > /dev/null 2>&1
15 rm -f ${RESULTS} > /dev/null 2>&1
16 today=`date`
17 echo "${today}" > ${LOG}
18 touch ${RESULTS}
21 _aclocal ()
23 aclocal "$@" >> ${LOG} 2>&1
24 if [ $? -ne 0 ]; then
25 echo "Error running aclocal"
26 exit 1
30 _autoheader ()
32 autoheader "$@" >> ${LOG} 2>&1
33 if [ $? -ne 0 ]; then
34 echo "Error running autoheader"
35 exit 1
39 _automake ()
41 automake "$@" >> ${LOG} 2>&1
42 if [ $? -ne 0 ]; then
43 echo "Error running automake"
44 exit 1
48 _autoconf ()
50 autoconf "$@" >> ${LOG} 2>&1
51 if [ $? -ne 0 ]; then
52 echo "Error running autoconf"
53 exit 1
57 classpath_checkout ()
59 if [ ! -d "${CLASSPATH_CVS}" ]; then
60 mkdir --parents ${CLASSPATH_CVS}
61 local dir=`dirname "${CLASSPATH_CVS}"`
62 cd "${dir}"
63 cvs -z3 -d :pserver:anoncvs@subversions.gnu.org:/cvsroot/classpath co classpath >> ${LOG} 2>/dev/null
64 if [ $? -ne 0 ]; then
65 echo "Error checking out classpath"
66 exit 1
71 classpath_update ()
73 cd "${CLASSPATH_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
74 if [ $? -ne 0 ]; then
75 echo "Error checking out classpath"
76 exit 1
80 classpath_clean ()
82 if [ -d "${CLASSPATH_CVS}/build" ]; then
83 rm -rf "${CLASSPATH_CVS}/build"
85 if [ -d "${CLASSPATH_PREFIX}" ]; then
86 rm -rf "${CLASSPATH_PREFIX}"
88 mkdir --parents "${CLASSPATH_CVS}/build"
89 mkdir --parents "${CLASSPATH_PREFIX}"
92 classpath_configure ()
94 cd "${CLASSPATH_CVS}"
96 _aclocal
97 _autoheader
98 _automake
99 _autoconf
101 cd "${CLASSPATH_CVS}/build" && ../configure --prefix=${CLASSPATH_PREFIX} --with-gcj --enable-jni >> ${LOG} 2>&1
102 if [ $? -ne 0 ]; then
103 echo "Error configuring"
104 exit 1
108 classpath_build ()
110 cd "${CLASSPATH_CVS}/build" && make >> ${LOG} 2>&1
111 if [ $? -ne 0 ]; then
112 echo "Error during make"
113 exit 1
117 classpath_install ()
119 cd "${CLASSPATH_CVS}/build" && make install >> ${LOG} 2>&1
120 if [ $? -ne 0 ]; then
121 echo "Error during make"
122 exit 1
126 kissme_checkout ()
128 if [ ! -d "${KISSME_CVS}" ]; then
129 mkdir --parents ${KISSME_CVS}
130 local dir=`dirname "${KISSME_CVS}"`
131 cd "${KISSME_CVS}"
132 cvs -z3 -d :pserver:anonymous@cvs.kissme.sourceforge.net:/cvsroot/kissme co . >> ${LOG} 2>/dev/null
133 if [ $? -ne 0 ]; then
134 echo "Error checking out kissme"
135 exit 1
140 kissme_update ()
142 cd "${KISSME_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
143 if [ $? -ne 0 ]; then
144 echo "Error checking out kissme"
145 exit 1
149 kissme_clean ()
151 if [ -d "${KISSME_CVS}/build" ]; then
152 rm -rf "${KISSME_CVS}/build"
154 if [ -d "${KISSME_PREFIX}" ]; then
155 rm -rf "${KISSME_PREFIX}"
157 mkdir --parents "${KISSME_CVS}/build"
158 mkdir --parents "${KISSME_PREFIX}"
161 kissme_configure ()
163 cd "${KISSME_CVS}"
165 _aclocal
166 _autoheader
167 _automake -a
168 _autoconf
170 cd "${KISSME_CVS}" && ./configure --prefix=${KISSME_PREFIX} \
171 --enable-use-zips --with-gnu-classpath=${CLASSPATH_CVS} \
172 --with-gnu-classpath-build=${CLASSPATH_CVS}/build \
173 --with-classpath-install-dir=${CLASSPATH_PREFIX} >> ${LOG} 2>&1
175 if [ $? -ne 0 ]; then
176 echo "Error configuring"
177 exit 1
181 kissme_build ()
183 cd "${KISSME_CVS}" && make >> ${LOG} 2>&1
184 if [ $? -ne 0 ]; then
185 echo "Error during make"
186 exit 1
190 kissme_install ()
192 cd "${KISSME_CVS}" && make install >> ${LOG} 2>&1
193 if [ $? -ne 0 ]; then
194 echo "Error during make"
195 exit 1
199 mauve_checkout ()
201 if [ ! -d "${MAUVE_CVS}" ]; then
202 mkdir --parents ${MAUVE_CVS}
203 local dir=`dirname "${MAUVE_CVS}"`
204 cd "${dir}"
205 cvs -z3 -d :pserver:anoncvs@sources.redhat.com:/cvs/mauve co mauve >> ${LOG} 2>/dev/null
206 if [ $? -ne 0 ]; then
207 echo "Error checking out mauve"
208 exit 1
213 mauve_update ()
215 cd "${MAUVE_CVS}" && cvs update -d -P . >> ${LOG} 2>/dev/null
216 if [ $? -ne 0 ]; then
217 echo "Error checking out mauve"
218 exit 1
222 kissme_mauve ()
224 export JAVAC="jikes -bootclasspath ${CLASSPATH_PREFIX}/share/classpath/glibj.zip"
225 export JAVA="${KISSME_BIN}"
227 # if [ -f "${KISSME_CVS}/useful_scripts/mauve-kissme" ]; then
228 # cp -f "${KISSME_CVS}/useful_scripts/mauve-kissme" "${MAUVE_CVS}"
229 # fi
231 if [ -f "${CLASSPATH_CVS}/mauve-classpath" ]; then
232 cp -f "${CLASSPATH_CVS}/mauve-classpath" "${MAUVE_CVS}"
235 cd "${MAUVE_CVS}"
236 if [ $? -ne 0 ]; then
237 echo "Error configuring mauve"
238 exit 1
241 _aclocal
242 _automake
243 _autoconf
245 ./configure >> "${LOG}" 2>&1
246 if [ $? -ne 0 ]; then
247 echo "Error configuring mauve"
248 exit 1
251 # create class choices from key file
252 if [ -f classes ]; then
253 rm -f classes 2>/dev/null
255 if [ -f choices ]; then
256 rm -f choices 2>/dev/null
258 /bin/sh choose "${MAUVE_CVS}" classpath
259 if [ $? -ne 0 ]; then
260 echo "Error during choose for mauve"
261 exit 1
264 # compile classes
265 compile=`cat "${MAUVE_CVS}/classes" | tr '.' '/' | awk '{print $1".java"}' | xargs`
266 ${JAVAC} -classpath "${MAUVE_CVS}" -d "${MAUVE_CVS}" ${compile} >> "${LOG}" 2>&1
267 if [ $? -ne 0 ]; then
268 echo "Error during compile for mauve"
269 exit 1
272 set -m
273 for i in `cat "${MAUVE_CVS}/classes"`; do
274 echo "$i" | ${JAVA} gnu.testlet.SimpleTestHarness -verbose >> "${RESULTS}" 2>&1 &
276 vm_pid=$!
277 sleep ${TIMEOUT} && kill -9 $vm_pid > /dev/null 2>&1 && echo "FAIL: $i execution aborted" >> "${RESULTS}" &
278 kill_pid=$!
279 fg %- 2>/dev/null
280 kill -9 $kill_pid >/dev/null 2>&1 # && echo Test did not time out
281 done
284 mauve_summary ()
286 if [ ! -f "${RESULTS}" ]; then
287 echo "Error creating summary"
288 exit 1
291 pass_cnt=`grep PASS "${RESULTS}" | wc -l`
292 fail_cnt=`grep FAIL "${RESULTS}" | wc -l`
293 total_cnt=`expr $pass_cnt + $fail_cnt`
295 today=`date`
296 echo "Mauve test results for Kissme" > "${REPORT}"
297 echo "Report generated on ${today}" >> "${REPORT}"
298 echo "" >> "${REPORT}"
299 echo "${fail_cnt} of ${total_cnt} tests failed." >> "${REPORT}"
300 echo "" >> "${REPORT}"
301 cat "${RESULTS}" >> "${REPORT}"
304 #--------------------------------------------------------------------
305 # Update Classpath CVS
306 #--------------------------------------------------------------------
307 classpath_checkout
308 classpath_update
310 #--------------------------------------------------------------------
311 # Build Classpath with GCJ 3.2
312 #--------------------------------------------------------------------
313 classpath_clean
314 classpath_configure
315 classpath_build
316 classpath_install
318 #--------------------------------------------------------------------
319 # Update Kissme CVS
320 #--------------------------------------------------------------------
321 kissme_checkout
322 kissme_update
324 #--------------------------------------------------------------------
325 # Build Kissme
326 #--------------------------------------------------------------------
327 kissme_clean
328 kissme_configure
329 kissme_build
330 #kissme_install
332 #--------------------------------------------------------------------
333 # Update Mauve CVS
334 #--------------------------------------------------------------------
335 mauve_checkout
336 mauve_update
338 #--------------------------------------------------------------------
339 # Execute Mauve
340 #--------------------------------------------------------------------
341 kissme_mauve
343 #--------------------------------------------------------------------
344 # Create report
345 #--------------------------------------------------------------------
346 mauve_summary