diff options
author | André Nusser <andre.nusser@googlemail.com> | 2016-01-30 19:53:04 +0100 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2016-01-30 19:53:04 +0100 |
commit | 4537f042717e0dba2a917d573309c825eaffd8f3 (patch) | |
tree | 011cc603e7e8eb87fde3060a3fd4c8aaeee8ba02 | |
parent | 1686577eaa7a009d8a62474085a1a22855776719 (diff) |
Improve the valgrind test output.
-rwxr-xr-x | tools/valgrind_test/valgrind_test | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/tools/valgrind_test/valgrind_test b/tools/valgrind_test/valgrind_test index c5efc32..b06342e 100755 --- a/tools/valgrind_test/valgrind_test +++ b/tools/valgrind_test/valgrind_test @@ -3,6 +3,8 @@ test_dir=$(dirname $0) cd $test_dir +dg_path="../../drumgizmo" + memcheck_log_file="valgrind_memcheck.log" helgrind_log_file="valgrind_helgrind.log" dg_log_file="drumgizmo.log" @@ -13,6 +15,21 @@ wav_file_prefix="valgrind_test" midimap="../../test/kit/midimap.xml" drumkit="../../test/kit/kit1.xml" +# check for drumgizmo +if ! [ -e $dg_path/drumgizmo ] +then + echo "ERROR: The drumgizmo binary doesn't exist. Maybe you forgot to compile?" + exit +fi + +# check for valgrind +if ! command -v valgrind >/dev/null 2>&1 +then + echo "ERROR: Cannot find valgrind. Maybe it isn't installed?" + exit +fi + +# print nice header echo "===========================================" echo "Starting the valgrind test" echo @@ -26,8 +43,10 @@ echo "----------------" echo # run memcheck and print summary -valgrind $memcheck_options ../../drumgizmo/./drumgizmo -i midifile -I file=$midi_file,midimap=$midimap -o wavfile -O file=$wav_file_prefix $drumkit > /dev/null +valgrind $memcheck_options $dg_path/./drumgizmo -i midifile -I file=$midi_file,midimap=$midimap -o wavfile -O file=$wav_file_prefix $drumkit > /dev/null sed -n '/LEAK SUMMARY:/,$p' $memcheck_log_file +echo +echo "=> For details see: $memcheck_log_file" echo echo "----------------" @@ -36,8 +55,10 @@ echo "----------------" echo # run helgrind and print summary -valgrind $helgrind_options ../../drumgizmo/./drumgizmo -i midifile -I file=$midi_file,midimap=$midimap -o wavfile -O file=$wav_file_prefix $drumkit > $dg_log_file +valgrind $helgrind_options $dg_path/./drumgizmo -i midifile -I file=$midi_file,midimap=$midimap -o wavfile -O file=$wav_file_prefix $drumkit > $dg_log_file sed -n '/ERROR SUMMARY:/,$p' $helgrind_log_file +echo +echo "=> For details see: $helgrind_log_file" echo |