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