From 6b702024c9e6d06c74fccc20122f24a72560d54b Mon Sep 17 00:00:00 2001
From: José Bollo <jose.bollo@iot.bzh>
Date: Thu, 14 Feb 2019 11:41:21 +0100
Subject: coverage: Allow removal of valgrind
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It can be usefull for debugging with gdb to
avoid the use of valgrind in the test.

This can be done by setting the environment
NOVALGRIND to any not empty value.

Also add more temporary files to ignore.

Change-Id: I853eb566607aa7ec87c356ee3acd9b1fa658b659
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
---
 coverage/scripts/run-test.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

(limited to 'coverage/scripts')

diff --git a/coverage/scripts/run-test.sh b/coverage/scripts/run-test.sh
index be083654..ee0fb00a 100755
--- a/coverage/scripts/run-test.sh
+++ b/coverage/scripts/run-test.sh
@@ -7,6 +7,20 @@ cd $R/bin
 
 lcov -c -i -d $R/bin -o $R/lcov-out.info
 
+vg() {
+	if [[ -z "$NOVALGRIND" ]]; then
+		valgrind "$@"
+	else
+		while :; do
+			case "$1" in
+			--*) shift;;
+			*) break;;
+			esac
+		done
+		"$@"
+	fi
+}
+
 mk() {
 	echo
 	echo "*******************************************************************"
@@ -78,7 +92,7 @@ mk $R/bin/test-wrap-json
 # true life test
 ##########################################################
 mk \
-valgrind \
+vg \
 	--log-file=$R/valgrind.out \
 	--trace-children=no \
 	--track-fds=yes \
-- 
cgit