Ram Gandikota
/
IOTMetronome
FRDM K64F Metronome
Diff: mbed-client/mbed-client-classic/run_unit_tests_with_valgrind.sh
- Revision:
- 0:dbad57390bd1
diff -r 000000000000 -r dbad57390bd1 mbed-client/mbed-client-classic/run_unit_tests_with_valgrind.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-client/mbed-client-classic/run_unit_tests_with_valgrind.sh Sun May 14 18:37:05 2017 +0000 @@ -0,0 +1,14 @@ +#!/bin/bash +# Execute script with root path where to find binaries. +# For example ./run_unit_tests_with_valgrind.sh ./build/x86-linux-native-coverage/test/mbedclient/ + +input="binaries.txt" +valgrind_logs="valgrind_logs" +rm -rf $valgrind_logs +mkdir $valgrind_logs +find $1 -type f -executable -exec sh -c "file -i '{}' | grep -q 'x-executable; charset=binary'" \; -print > $input +while file= read -r binary +do + valgrind --track-origins=yes --xml=yes --xml-file="${valgrind_logs}/valgrind_$(basename $binary).xml" "$binary" + +done < "$input" \ No newline at end of file