From f1acfee36090984f24cf065015975407dd9e5218 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 6 Jul 2018 08:53:45 -0700 Subject: [PATCH] test: make unittest.sh work from any directory test/unit/unittest.sh would normally have to be invoked from the root of the SPDK repository; tweak it slightly so that it can be executed from any working directory (e.g. within test/unit). Change-Id: I8fdbb7c0d618e2bb1490236212e54cbd43cccf6f Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/418217 Reviewed-by: Paul Luse Reviewed-by: Ben Walker Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- test/unit/unittest.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index 7cd0a98da..b1a545086 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -9,6 +9,8 @@ set -xe testdir=$(readlink -f $(dirname $0)) rootdir=$(readlink -f $(dirname $0)/../..) +cd "$rootdir" + # if ASAN is enabled, use it. If not use valgrind if installed but allow # the env variable to override the default shown below. if [ -z ${valgrind+x} ]; then @@ -148,7 +150,7 @@ echo "=====================" echo "All unit tests passed" echo "=====================" if [ "$cov_avail" = "yes" ]; then - echo "Note: coverage report is here: ./$UT_COVERAGE" + echo "Note: coverage report is here: $rootdir/$UT_COVERAGE" else echo "WARN: lcov not installed or SPDK built without coverage!" fi