[gtk/wip/sadiq/ci] ci: Add coverage support



commit d429fe2b2be7f2afd8278724ce66724c0d2797a0
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Tue Sep 18 08:48:41 2018 +0530

    ci: Add coverage support

 .gitlab-ci.yml            | 3 +++
 .gitlab-ci/test-docker.sh | 3 +++
 2 files changed, 6 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a67069ebee..8552f4a94a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,9 +14,12 @@ stages:
 
 fedora-x86_64:
   image: registry.gitlab.gnome.org/gnome/gtk/master:v1
+  before_script:
+    - dnf install -y lcov
   stage: build
   script:
     - bash -x ./.gitlab-ci/test-docker.sh
+  coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
   artifacts:
     when: on_failure
     name: "gtk-${CI_COMMIT_REF_NAME}"
diff --git a/.gitlab-ci/test-docker.sh b/.gitlab-ci/test-docker.sh
index 47cb9e9daf..50a297bbc6 100755
--- a/.gitlab-ci/test-docker.sh
+++ b/.gitlab-ci/test-docker.sh
@@ -12,6 +12,7 @@ ccache --zero-stats
 ccache --show-stats
 export CCACHE_DISABLE=true
 meson \
+        -Db_coverage=true \
         -Dx11-backend=true \
         -Dwayland-backend=true \
         -Dbroadway-backend=true \
@@ -30,3 +31,5 @@ xvfb-run -a -s "-screen 0 1024x768x24" \
         --suite=gtk+ \
         --no-suite=gtk+:gsk \
         --no-suite=gtk+:a11y
+
+ninja coverage


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]