]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: ignore missing coverage in TEST-02 23000/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 7 Apr 2022 10:45:13 +0000 (12:45 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 7 Apr 2022 10:45:13 +0000 (12:45 +0200)
Since c6552ad we now try to collect coverage even in situations where
it's basically impossible (like in test-mount-util where the whole / is
mounted as read-only). As dealing with this is not worth the trouble,
let's ignore the missing coverage errors thrown by gcov in such cases.

test/TEST-02-UNITTESTS/test.sh
test/test-functions

index 571abe41c339dd6e1ff5ab7c60814e82a34df1ac..80cb82a50d110f650c16ef328e3718624b0c2d9f 100755 (executable)
@@ -4,6 +4,10 @@ set -e
 
 TEST_DESCRIPTION="Run unit tests under containers"
 RUN_IN_UNPRIVILEGED_CONTAINER=yes
+# Some tests make collecting coverage impossible (like test-mount-util, which
+# remounts the whole / as read-only), so let's ignore the gcov errors in such
+# case
+IGNORE_MISSING_COVERAGE=yes
 
 # embed some newlines in the kernel command line to stress our test suite
 KERNEL_APPEND="
index c734a15ca91b1caa1c734217c0bafac97e7419e3..47eae9f0cbd938bc778740c69da2fda4a8547efe 100644 (file)
@@ -1406,8 +1406,8 @@ check_coverage_reports() {
     # usually due to the sandbox being too restrictive (e.g. ProtectSystem=yes,
     # ProtectHome=yes) or the $BUILD_DIR being inaccessible to non-root users - see
     # `setfacl` stuff in install_compiled_systemd().
-
-    if "${JOURNALCTL:?}" -q --no-pager -D "${root:?}/var/log/journal" --grep "profiling:.+?gcda:[Cc]annot open"; then
+    if ! get_bool "${IGNORE_MISSING_COVERAGE:=}" && \
+       "${JOURNALCTL:?}" -q --no-pager -D "${root:?}/var/log/journal" --grep "profiling:.+?gcda:[Cc]annot open"; then
         derror "Detected possibly missing coverage, check the journal"
         return 1
     fi