shithub: dav1d

Download patch

ref: 2b98fd286cbe6768ce9877314cba9fc4ffa11259
parent: a2f90805e00a9f7e0aec50a7b7d3abcd670cad14
author: Niklas Haas <git@haasn.xyz>
date: Wed May 27 12:24:03 EDT 2020

CI: Enable coverage reports

Blacklisted some files not directly relevant to the codebase (such as
tests, tools and debugging functions).

The coverage HTML report gets attached as a build artifact, although
unfortunately we can't link directly to the `index.html`. We also attach
the coverage XML as a cobertura report, although I'm not sure if it does
anything.

--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -4,7 +4,7 @@
     - test
 
 .debian-amd64-common:
-    image: registry.videolan.org/dav1d-debian-unstable:20200306210534
+    image: registry.videolan.org/dav1d-debian-unstable:20200602183013
     stage: build
     tags:
         - docker
@@ -383,8 +383,21 @@
         - meson build --buildtype release
                       -Dtestdata_tests=true
                       -Dlogging=false
+                      -Db_coverage=true
         - ninja -C build
         - cd build && time meson test -v
+        - ninja coverage-html
+        - mv meson-logs/coveragereport ../coverage
+        - ninja coverage-xml
+        - grep -Eo 'line-rate="[^"]+"' meson-logs/coverage.xml | head -n 1 |
+          grep -Eo '[0-9.]+' | awk '{ print "coverage:", $1 * 100 } '
+    coverage: '/^coverage: (\d+.\d+)$/'
+    artifacts:
+        expose_as: 'Coverage HTML report'
+        paths:
+            - coverage/
+        reports:
+            cobertura: build/meson-logs/coverage.xml
 
 test-debian-asm:
     extends:
--- /dev/null
+++ b/gcovr.cfg
@@ -1,0 +1,3 @@
+exclude = .*/tests/.*
+exclude = .*/tools/.*
+exclude = .*/include/common/dump.h