]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Drop unnecessary gcovr workarounds
authorMichal Nowak <mnowak@isc.org>
Mon, 24 Jul 2023 15:30:35 +0000 (17:30 +0200)
committerMichal Nowak <mnowak@isc.org>
Mon, 21 Aug 2023 14:35:52 +0000 (16:35 +0200)
Many problems of the Debian 11 gcovr version were fixed in the Debian 12
one. Replace workarounds we accumulated over the years with two new,
simple ones.

.gitlab-ci.yml

index a089757df9bf99c256a34f78ccaa7b0e6eddfb74..afd250d1d82ce3ab9358ced64ae4e737c0957a38 100644 (file)
@@ -1704,33 +1704,24 @@ gcov:
     - job: system:gcc:bookworm:amd64
       artifacts: true
   script:
-    # *.gcno and *.gcda files generated for shared library objects are created
-    # in directories in which gcovr is unable to process them properly
-    # (.../.libs/...).  Move such *.gcno and *.gcda files one level higher.
-    - find . -regex ".*/\.libs/.*\.\(gcda\|gcno\)" -execdir mv "{}" .. \;
-    # Help gcovr process the nasty tricks in lib/dns/code.h, where we include C
-    # source files from lib/dns/rdata/*/, using an even nastier trick.
-    - find lib/dns/rdata/* -name "*.c" -execdir cp -f "{}" ../../ \;
-    # Help gcovr process inline functions in headers by copying all libdns and
-    # libisc headers to lib/{dns,isc,ns}/.
-    - for SRC in dns isc; do for DST in dns isc ns; do cp -f "lib/${SRC}/include/${SRC}"/*.h "lib/${DST}/"; done; done
-    - find bin lib -maxdepth 1 -mindepth 1 -type d -exec cp -f lib/isc/include/isc/buffer.h "{}" \;
-    - cp -f lib/isc/include/isc/buffer.h lib/isc/netmgr/buffer.h
-    - cp -f lib/isc/include/isc/dnsstream.h lib/isc/netmgr/dnsstream.h
-    - cp -f lib/isc/include/isc/tid.h lib/isc/netmgr/tid.h
-    # Help gcovr find dlz_dbi.c file
-    - for DST in ldap mysql mysqldyn sqlite3 wildcard; do cp contrib/dlz/modules/common/dlz_dbi.c "contrib/dlz/modules/${DST}"; done
+    # Ensure gcov files for unit tests are found via tests/ rather than
+    # lib/*/tests/ to prevent confusing gcovr.
+    - find lib/ -name tests -type l -delete
+    # The "a-conftest.gcno" file is result of the ./configure step and
+    # should be removed as it does not belong to the BIND 9 code base.
+    - rm a-conftest.gcno
     # Generate XML file in the Cobertura XML format suitable for use by GitLab
     # for the purpose of displaying code coverage information in the diff view
     # of a given merge request.
-    - gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude-directories lib/samples --exclude tests --xml -o coverage.xml
-    - gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude-directories lib/samples --exclude tests --html-details -o coverage.html
-    - gcovr --root . --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude-directories lib/samples --exclude tests -o coverage.txt
+    - gcovr --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude tests --cobertura-pretty -o coverage.xml
+    - gcovr --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude tests --html-details -o coverage.html
+    - gcovr --exclude-directories bin/tests --exclude-directories doc --exclude-directories fuzz --exclude tests --txt -o coverage.txt
     - tail -n 3 coverage.txt
   coverage: /^TOTAL.*\s+(\d+\%)$/
   artifacts:
     paths:
       - coverage*.html
+      - coverage.css
       - coverage.txt
       - coverage.xml
     reports: