From 8e0d758f852b0b4e4242b7fb2ebee8cbd17fc2f4 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Thu, 19 Mar 2015 15:35:04 +0100 Subject: Hint how to use Dr.Memory for unit tests / memory checking. Change-Id: I7df8716e90e9097336919d2a9208a549b8f7d3d0 --- solenv/bin/unittest-failed.sh | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'solenv/bin/unittest-failed.sh') diff --git a/solenv/bin/unittest-failed.sh b/solenv/bin/unittest-failed.sh index 6bbd458cc263..b1e93d5267aa 100755 --- a/solenv/bin/unittest-failed.sh +++ b/solenv/bin/unittest-failed.sh @@ -17,27 +17,28 @@ # except in compliance with the License. You may obtain a copy of # the License at http://www.apache.org/licenses/LICENSE-2.0 . -cat << EOF - -Error: a unit test failed, please do one of: +ECHECKING='export DEBUGCPPUNIT=TRUE # for exception catching' +DEBUGGING= +MCHECKING='export VALGRIND=memcheck # for memory checking' -export DEBUGCPPUNIT=TRUE # for exception catching -EOF if [ "$3" = "WNT" ]; then -cat << EOF -export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive debugging in Visual Studio -EOF + ECHECKING='export DEBUGCPPUNIT=TRUE # for exception catching' + DEBUGGING='export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive debugging in Visual Studio' + MCHECKING='export CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first)' elif [ "$3" = "MACOSX" ]; then -cat << EOF -export CPPUNITTRACE="lldb --" # for interactive debugging on OS X -EOF + DEBUGGING='export CPPUNITTRACE="lldb --" # for interactive debugging on OS X' else -cat << EOF -export CPPUNITTRACE="gdb --args" # for interactive debugging on Linux -EOF + DEBUGGING='export CPPUNITTRACE="gdb --args" # for interactive debugging on Linux' fi + +# print the actual error message cat << EOF -export VALGRIND=memcheck # for memory checking + +Error: a unit test failed, please do one of: + +$ECHECKING +$DEBUGGING +$MCHECKING and retry using: make $1Test_$2 -- cgit v1.2.3