]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make the coverage check safer for non-compiled builds 21081/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 21 Oct 2021 16:34:21 +0000 (18:34 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 21 Oct 2021 16:34:21 +0000 (18:34 +0200)
test/test-functions

index 54be19ffc03e7a6cd92dfd857e785d269ba24422..98b60d17f8ffc97b349f69c2b263084a86081fab 100644 (file)
@@ -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