teach test.sh to run valgrind when in stress testing mode

This commit is contained in:
Joel Dice 2007-07-17 19:42:14 -06:00
parent 65c876b5f7
commit c94e70060f
2 changed files with 15 additions and 2 deletions

View File

@ -149,7 +149,7 @@ vg: $(executable) $(input)
.PHONY: test .PHONY: test
test: $(executable) $(classpath-objects) $(test-classes) test: $(executable) $(classpath-objects) $(test-classes)
LD_LIBRARY_PATH=$(bld) /bin/bash $(test)/test.sh \ LD_LIBRARY_PATH=$(bld) /bin/bash $(test)/test.sh \
$(<) "$(flags)" $(call class-names,$(test-classes)) $(<) $(mode) "$(flags)" $(call class-names,$(test-classes))
.PHONY: clean .PHONY: clean
clean: clean:

View File

@ -1,8 +1,11 @@
#!/bin/bash #!/bin/bash
log=build/log.txt log=build/log.txt
vg="valgrind --leak-check=full --num-callers=32 --db-attach=yes \
--freelist-vol=100000000"
vm=${1}; shift vm=${1}; shift
mode=${1}; shift
flags=${1}; shift flags=${1}; shift
tests=${@} tests=${@}
@ -11,7 +14,17 @@ echo -n "" >${log}
for test in ${tests}; do for test in ${tests}; do
printf "${test}: " printf "${test}: "
${vm} ${flags} ${test} >>${log} 2>&1 case ${mode} in
debug )
${vm} ${flags} ${test} >>${log} 2>&1;;
stress* )
${vg} ${vm} ${flags} ${test} >>${log} 2>&1;;
* )
echo "unknown mode: ${mode}" >&2
exit 1;;
esac
if (( ${?} == 0 )); then if (( ${?} == 0 )); then
echo "success" echo "success"