61 lines
972 B
Bash
Raw Normal View History

2009-08-06 15:58:26 -06:00
#!/bin/sh
2007-07-19 17:45:44 -06:00
vg="nice valgrind --leak-check=full --num-callers=32 \
--freelist-vol=100000000 --error-exitcode=1"
ld_path=${1}; shift
2013-02-14 20:54:20 -07:00
unit_tester=${1}; shift
vm=${1}; shift
mode=${1}; shift
flags=${1}; shift
tests=${@}
2013-02-14 20:54:20 -07:00
log=log.txt
if [ -n "${ld_path}" ]; then
2013-12-06 19:30:04 -07:00
export ${ld_path}
fi
echo -n "" >${log}
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
echo
printf "%20s------- Java tests -------\n" ""
for test in ${tests}; do
printf "%32s: " "${test}"
case ${mode} in
debug|debug-fast|fast|small )
${vm} ${flags} ${test} >>${log} 2>&1;;
stress* )
${vg} ${vm} ${flags} ${test} \
>>${log} 2>&1;;
* )
echo "unknown mode: ${mode}" >&2
exit 1;;
esac
2009-08-06 15:58:26 -06:00
if [ "${?}" = "0" ]; then
echo "success"
else
echo "fail"
trouble=1
fi
done
echo
if [ -n "${trouble}" ]; then
printf "see ${log} for output\n"
exit -1
fi