autotest: Fix for disable lcov when using clang

Previous commit #ddba844, has wrong path in unittest.sh
and missing checks in unittest.sh and autotest.sh, that here was fixed.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Idc12719c0d427e3e6ec1a0e2c57e899508b0d7f5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5364
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Maciej Wawryk 2020-12-01 08:48:29 +01:00 committed by Tomasz Zawadzki
parent aff588d7e6
commit 78d5bfe575
2 changed files with 10 additions and 11 deletions

View File

@ -62,7 +62,11 @@ cd $src
freebsd_update_contigmem_mod
if hash lcov; then
# lcov takes considerable time to process clang coverage.
# Disabling lcov allow us to do this.
# 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="
@ -324,10 +328,6 @@ trap - SIGINT SIGTERM EXIT
# catch any stray core files
process_core
# lcov takes considerable time to process clang coverage.
# Disabling lcov allow us to do this.
# More information: https://github.com/spdk/spdk/issues/1693
CC_TYPE=$(grep CC_TYPE mk/cc.mk)
if hash lcov && ! [[ "$CC_TYPE" == *"clang"* ]]; then
# generate coverage data and combine with baseline
$LCOV -q -c -d $src -t "$(hostname)" -o $out/cov_test.info

View File

@ -135,7 +135,11 @@ if [ -z ${valgrind+x} ]; then
fi
# setup local unit test coverage if cov is available
if hash lcov && grep -q '#define SPDK_CONFIG_COVERAGE 1' $rootdir/include/spdk/config.h; then
# lcov takes considerable time to process clang coverage.
# Disabling lcov allow us to do this.
# More information: https://github.com/spdk/spdk/issues/1693
CC_TYPE=$(grep CC_TYPE $rootdir/mk/cc.mk)
if hash lcov && grep -q '#define SPDK_CONFIG_COVERAGE 1' $rootdir/include/spdk/config.h && ! [[ "$CC_TYPE" == *"clang"* ]]; then
cov_avail="yes"
else
cov_avail="no"
@ -220,11 +224,6 @@ if grep -q '#define SPDK_CONFIG_VHOST 1' $rootdir/include/spdk/config.h; then
run_test "unittest_vhost" $valgrind $testdir/lib/vhost/vhost.c/vhost_ut
fi
# local unit test coverage
# lcov takes considerable time to process clang coverage.
# Disabling lcov allow us to do this.
# More information: https://github.com/spdk/spdk/issues/1693
CC_TYPE=$(grep CC_TYPE mk/cc.mk)
if [ "$cov_avail" = "yes" ] && ! [[ "$CC_TYPE" == *"clang"* ]]; then
$LCOV -q -d . -c -t "$(hostname)" -o $UT_COVERAGE/ut_cov_test.info
$LCOV -q -a $UT_COVERAGE/ut_cov_base.info -a $UT_COVERAGE/ut_cov_test.info -o $UT_COVERAGE/ut_cov_total.info