2009-08-06 21:58:26 +00:00
|
|
|
#!/bin/sh
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2007-07-19 23:45:44 +00:00
|
|
|
vg="nice valgrind --leak-check=full --num-callers=32 \
|
|
|
|
--freelist-vol=100000000 --error-exitcode=1"
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2013-02-15 00:21:57 +00:00
|
|
|
ld_path=${1}; shift
|
2013-02-15 03:54:20 +00:00
|
|
|
unit_tester=${1}; shift
|
2007-07-16 01:03:02 +00:00
|
|
|
vm=${1}; shift
|
2007-07-18 01:42:14 +00:00
|
|
|
mode=${1}; shift
|
2007-07-16 01:03:02 +00:00
|
|
|
flags=${1}; shift
|
|
|
|
tests=${@}
|
|
|
|
|
2013-02-15 03:54:20 +00:00
|
|
|
log=log.txt
|
|
|
|
|
2013-12-07 03:51:22 +00:00
|
|
|
if [ -n "${ld_path}" ]; then
|
2013-12-07 02:30:04 +00:00
|
|
|
export ${ld_path}
|
|
|
|
fi
|
2013-02-15 00:21:57 +00:00
|
|
|
|
2007-07-16 01:03:02 +00:00
|
|
|
echo -n "" >${log}
|
|
|
|
|
2014-03-18 15:49:00 +00:00
|
|
|
printf "%20s------- Unit tests -------\n" ""
|
2013-02-15 03:54:20 +00:00
|
|
|
${unit_tester} 2>>${log}
|
|
|
|
if [ "${?}" != "0" ]; then
|
|
|
|
trouble=1
|
2013-02-17 19:10:18 +00:00
|
|
|
echo "unit tests failed!"
|
2013-02-15 03:54:20 +00:00
|
|
|
fi
|
|
|
|
|
2007-07-26 00:48:28 +00:00
|
|
|
echo
|
|
|
|
|
2014-03-18 15:49:00 +00:00
|
|
|
printf "%20s------- Java tests -------\n" ""
|
2007-07-16 01:03:02 +00:00
|
|
|
for test in ${tests}; do
|
2014-03-18 15:49:00 +00:00
|
|
|
printf "%32s: " "${test}"
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2007-07-18 01:42:14 +00:00
|
|
|
case ${mode} in
|
2008-11-11 15:20:49 +00:00
|
|
|
debug|debug-fast|fast|small )
|
2010-11-16 03:28:53 +00:00
|
|
|
${vm} ${flags} ${test} >>${log} 2>&1;;
|
2007-07-18 01:42:14 +00:00
|
|
|
|
|
|
|
stress* )
|
2010-11-16 03:28:53 +00:00
|
|
|
${vg} ${vm} ${flags} ${test} \
|
2010-09-10 21:05:29 +00:00
|
|
|
>>${log} 2>&1;;
|
2007-07-18 01:42:14 +00:00
|
|
|
|
|
|
|
* )
|
|
|
|
echo "unknown mode: ${mode}" >&2
|
|
|
|
exit 1;;
|
|
|
|
esac
|
2007-07-16 01:03:02 +00:00
|
|
|
|
2009-08-06 21:58:26 +00:00
|
|
|
if [ "${?}" = "0" ]; then
|
2007-07-16 01:03:02 +00:00
|
|
|
echo "success"
|
|
|
|
else
|
|
|
|
echo "fail"
|
|
|
|
trouble=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2007-07-27 00:06:05 +00:00
|
|
|
echo
|
|
|
|
|
2007-07-16 01:03:02 +00:00
|
|
|
if [ -n "${trouble}" ]; then
|
2007-07-27 00:06:05 +00:00
|
|
|
printf "see ${log} for output\n"
|
2013-03-15 19:17:04 +00:00
|
|
|
exit -1
|
2007-07-16 01:03:02 +00:00
|
|
|
fi
|