From: Frantisek Sumsal Date: Thu, 21 Oct 2021 16:34:21 +0000 (+0200) Subject: test: make the coverage check safer for non-compiled builds X-Git-Tag: v250-rc1~454^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F21081%2Fhead;p=thirdparty%2Fsystemd.git test: make the coverage check safer for non-compiled builds --- diff --git a/test/test-functions b/test/test-functions index 54be19ffc03..98b60d17f8f 100644 --- a/test/test-functions +++ b/test/test-functions @@ -238,8 +238,16 @@ is_built_with_asan() { fi } +is_built_with_coverage() { + if get_bool "${NO_BUILD:=}" || ! command -v meson >/dev/null; then + return 1 + fi + + meson configure "${BUILD_DIR:?}" | grep 'b_coverage' | awk '{ print $2 }' | grep -q 'true' +} + IS_BUILT_WITH_ASAN=$(is_built_with_asan && echo yes || echo no) -IS_BUILT_WITH_COVERAGE=$(meson configure "${BUILD_DIR:?}" | grep 'b_coverage' | awk '{ print $2 }' | grep -q 'true' && echo yes || echo no) +IS_BUILT_WITH_COVERAGE=$(is_built_with_coverage && echo yes || echo no) if get_bool "$IS_BUILT_WITH_ASAN"; then STRIP_BINARIES=no