[nautilus: 1/3] CI: report code coverage



commit 10a6130bb75a9b18e4844dc36c4abaa4f3aeac5d
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sun Jan 7 20:24:10 2018 +0200

    CI: report code coverage

 .gitlab-ci.yml | 27 +++++++++++++++++++++++----
 README.md      |  3 +++
 2 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 975a5af20..bbe07c536 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,17 +1,36 @@
 image: fedora:27
 
 stages:
- - test
+  - test
 
 before_script:
   - dnf install -y gcc meson gettext itstool redhat-rpm-config git
                    gtk3-devel gnome-autoar-devel gnome-desktop3-devel
                    gobject-introspection-devel libselinux-devel
                    libxml2-devel tracker-devel desktop-file-utils
-                   libgexiv2-devel
+                   libgexiv2-devel gcovr
 
+# Coverage data contains paths relative to the build directory,
+# so changing to it makes writing filter expressions easier.
+#
+# _build/src/ contains generated sources, so that is filtered out as well.
 test:
   stage: test
   script:
-    - meson _build . -Ddisplay-tests=false
-    - ninja test -C _build
+    - meson _build . -Db_coverage=true -Ddisplay-tests=false
+    - cd _build
+    - ninja test
+    - gcovr --root=.
+      --exclude=src/
+      --exclude=../data/
+      --exclude=../eel/check-program.c
+      --exclude=../eel/eel-debug.c
+      --exclude=../eel/eel-lib-self-check-functions.c
+      --exclude=../eel/eel-self-checks.c
+      --exclude=../src/animation/
+      --exclude=../src/gtk/
+      --exclude=../src/nautilus-lib-self-check-functions.c
+      --exclude=../src/nautilus-self-check-functions.c
+      --exclude=../subprojects/libgd/
+      --exclude=../test/
+  coverage: '/^TOTAL.*\s+(\d+\%)$/'
diff --git a/README.md b/README.md
index 8c7e4c566..4334e69a6 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,8 @@
 # Nautilus
 ![Pipeline status](https://gitlab.gnome.org/GNOME/nautilus/badges/master/build.svg)
+![Code coverage](https://gitlab.gnome.org/GNOME/nautilus/badges/master/coverage.svg)
+
+
 
 This is [Nautilus](https://wiki.gnome.org/Apps/Nautilus), the file manager for
 GNOME.


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