From: Frantisek Sumsal Date: Tue, 21 May 2024 13:04:22 +0000 (+0200) Subject: test: make TEST-65-ANALYZE happy when built with gcov X-Git-Tag: v256-rc3~15^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95400d1d8365e20cca3ab60ec138104110925076;p=thirdparty%2Fsystemd.git test: make TEST-65-ANALYZE happy when built with gcov systemd-analyze runs the generators in a sandbox, which makes gcov unhappy since it can't update its counters. Let's "silence" gcov in this particular case by telling it to look for gcov note files in /tmp (where shouldn't be any, so gcov won't try to update any counters). --- diff --git a/test/units/TEST-65-ANALYZE.sh b/test/units/TEST-65-ANALYZE.sh index 5f650ade05a..18f5c4d804a 100755 --- a/test/units/TEST-65-ANALYZE.sh +++ b/test/units/TEST-65-ANALYZE.sh @@ -303,7 +303,9 @@ systemd-analyze security --offline=true /tmp/testfile.service systemd-analyze security --offline=true /tmp/testfile.service | grep -q -F "/dev/sda" # Make sure that running generators under systemd-analyze verify works. -systemd-analyze verify --generators /tmp/testfile.service +# Note: sd-analyze spawns generators in a sandbox which makes gcov unhapy, so temporarily override +# $GCOV_PREFIX to make it skip generating any coverage reports +GCOV_PREFIX=/tmp systemd-analyze verify --generators /tmp/testfile.service rm /tmp/testfile.service