From ddba8440c0104ef65b390e77516b7eed70c776d7 Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Thu, 19 Nov 2020 11:47:05 +0100 Subject: [PATCH] Disable lcov when using clang We want to add clang to autotest per patch, but lcov takes considerable time to process clang coverage. The test will be just building SPDK using clang. Details: https://github.com/spdk/spdk/issues/1693 Signed-off-by: Maciej Wawryk Change-Id: I085adb5498613222d36a0607b1fd260a2f4088b9 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5169 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- autotest.sh | 6 +++++- test/unit/unittest.sh | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autotest.sh b/autotest.sh index e7d54d0fa..3c911a7bd 100755 --- a/autotest.sh +++ b/autotest.sh @@ -324,7 +324,11 @@ trap - SIGINT SIGTERM EXIT # catch any stray core files process_core -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 # generate coverage data and combine with baseline $LCOV -q -c -d $src -t "$(hostname)" -o $out/cov_test.info $LCOV -q -a $out/cov_base.info -a $out/cov_test.info -o $out/cov_total.info diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index f55290edd..c2264bb97 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -221,7 +221,11 @@ if grep -q '#define SPDK_CONFIG_VHOST 1' $rootdir/include/spdk/config.h; then fi # local unit test coverage -if [ "$cov_avail" = "yes" ]; 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 [ "$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 $LCOV -q -a $UT_COVERAGE/ut_cov_total.info -o $UT_COVERAGE/ut_cov_unit.info