From fa030043dfb4377b87679d09fe562749e9105b02 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Fri, 18 Nov 2022 10:35:01 +0100 Subject: [PATCH] autotest: Make UT coverage setup independent from autotest.sh Signed-off-by: Michal Berger Change-Id: Idacba4abc5a33492e2de06522c446fd68230ea6b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15080 Tested-by: SPDK CI Jenkins Reviewed-by: Kamil Godzwon Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Reviewed-by: Konrad Sztyber --- autotest.sh | 2 -- test/unit/unittest.sh | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autotest.sh b/autotest.sh index f9c7f6086..f2d7a1224 100755 --- a/autotest.sh +++ b/autotest.sh @@ -66,8 +66,6 @@ freebsd_update_contigmem_mod # More information: https://github.com/spdk/spdk/issues/1693 CC_TYPE=$(grep CC_TYPE mk/cc.mk) if hash lcov && ! [[ "$CC_TYPE" == *"clang"* ]]; then - # setup output dir for unittest.sh - export UT_COVERAGE=$out/ut_coverage export LCOV_OPTS=" --rc lcov_branch_coverage=1 --rc lcov_function_coverage=1 diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index 1777325e5..95c3a8417 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -180,8 +180,10 @@ else fi if [ "$cov_avail" = "yes" ]; then # set unit test output dir if not specified in env var - if [ -z ${UT_COVERAGE+x} ]; then + if [[ -z $output_dir ]]; then UT_COVERAGE="ut_coverage" + else + UT_COVERAGE=$output_dir/ut_coverage fi mkdir -p $UT_COVERAGE export LCOV_OPTS="