From 8780063f2cb16d420ee654ae1c77d42c2407c7bc Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 5 Oct 2015 10:54:32 -0700 Subject: [PATCH] nvme: run unit tests under Valgrind if available Change-Id: Iad8403903d420418692793d9940e33e2d3772e6b Signed-off-by: Daniel Verkamp --- autobuild.sh | 2 ++ scripts/autotest_common.sh | 7 +++++++ test/lib/nvme/nvme.sh | 10 +++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index a406b87e75..e66a644596 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -8,6 +8,8 @@ out=$PWD MAKEFLAGS=${MAKEFLAGS:--j16} DPDK_DIR=/usr/local/dpdk-2.1.0/x86_64-native-linuxapp-gcc +umask 022 + cd $src ./scripts/check_format.sh diff --git a/scripts/autotest_common.sh b/scripts/autotest_common.sh index 9fcd8b3d3c..0db270f674 100755 --- a/scripts/autotest_common.sh +++ b/scripts/autotest_common.sh @@ -7,6 +7,13 @@ else output_dir=$rootdir/../output fi +if hash valgrind &> /dev/null; then + # TODO: add --error-exitcode=2 when all Valgrind warnings are fixed + valgrind='valgrind --leak-check=full' +else + valgrind='' +fi + function timing() { direction="$1" testname="$2" diff --git a/test/lib/nvme/nvme.sh b/test/lib/nvme/nvme.sh index a5a285b4e5..5a0c88e454 100755 --- a/test/lib/nvme/nvme.sh +++ b/test/lib/nvme/nvme.sh @@ -4,11 +4,11 @@ testdir=$(readlink -f $(dirname $0)) rootdir="$testdir/../../.." source $rootdir/scripts/autotest_common.sh -$testdir/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut -$testdir/unit/nvme_c/nvme_ut -$testdir/unit/nvme_qpair_c/nvme_qpair_ut -$testdir/unit/nvme_ctrlr_c/nvme_ctrlr_ut -$testdir/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut +$valgrind $testdir/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut +$valgrind $testdir/unit/nvme_c/nvme_ut +$valgrind $testdir/unit/nvme_qpair_c/nvme_qpair_ut +$valgrind $testdir/unit/nvme_ctrlr_c/nvme_ctrlr_ut +$valgrind $testdir/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut $testdir/aer/aer process_core