diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2022-04-07 15:08:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 15:08:55 +0200 |
commit | 673d1f4ab9a6b685db6b52f3784711a662458763 (patch) | |
tree | 4cc3cf22b6a0ce559adc750b9b745cdd8dd95692 /test | |
parent | sd-ipv4acd: actually drop the arp packet from one of the host interface (diff) | |
parent | test: ignore missing coverage in TEST-02 (diff) | |
download | systemd-673d1f4ab9a6b685db6b52f3784711a662458763.tar.xz systemd-673d1f4ab9a6b685db6b52f3784711a662458763.zip |
Merge pull request #23000 from mrc0mmand/coverage__exit
macro: call __gcov_dump() before _exit() w/ coverage enabled
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-02-UNITTESTS/test.sh | 4 | ||||
-rw-r--r-- | test/test-functions | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/TEST-02-UNITTESTS/test.sh b/test/TEST-02-UNITTESTS/test.sh index 571abe41c3..80cb82a50d 100755 --- a/test/TEST-02-UNITTESTS/test.sh +++ b/test/TEST-02-UNITTESTS/test.sh @@ -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=" diff --git a/test/test-functions b/test/test-functions index c734a15ca9..47eae9f0cb 100644 --- a/test/test-functions +++ b/test/test-functions @@ -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 |