[glib: 1/2] CI: Re-enable code coverage reporting for MSYS2 builds




commit 7d1e782c65bbf53df82db8e7cd89d91b1ec81661
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Wed Sep 30 11:36:49 2020 +0200

    CI: Re-enable code coverage reporting for MSYS2 builds
    
    It was disabled in !875 because lcov didn't support the new coverage
    format produced by gcc9+. The latest lcov release in MSYS2 supports
    it again, so re-enable everything.
    
    lcov now writes native Windows paths to its output so adjust the path
    fixup script to handle those.

 .gitlab-ci/fixup-cov-paths.py |  7 ++-----
 .gitlab-ci/test-msys2.sh      | 36 ++++++++++++++----------------------
 2 files changed, 16 insertions(+), 27 deletions(-)
---
diff --git a/.gitlab-ci/fixup-cov-paths.py b/.gitlab-ci/fixup-cov-paths.py
index d614b60e6..5fb77c64a 100644
--- a/.gitlab-ci/fixup-cov-paths.py
+++ b/.gitlab-ci/fixup-cov-paths.py
@@ -1,6 +1,7 @@
 import sys
 import os
 import io
+import re
 
 
 def main(argv):
@@ -12,11 +13,7 @@ def main(argv):
         print("cov-fixup:", path)
         text = io.open(path, "r", encoding="utf-8").read()
         text = text.replace("\\\\", "/")
-        glib_dir = "/glib/"
-        end = text.index(glib_dir)
-        start = text[:end].rindex(":") + 1
-        old_root = text[start:end]
-        assert os.path.basename(os.getcwd()) == "glib"
+        old_root = re.search(":(.*?)/glib/.*?$", text, re.MULTILINE).group(1)
         new_root = os.path.dirname(os.getcwd())
         if old_root != new_root:
             print("replacing %r with %r" % (old_root, new_root))
diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh
index 9845b1ac5..4485f8dbc 100755
--- a/.gitlab-ci/test-msys2.sh
+++ b/.gitlab-ci/test-msys2.sh
@@ -13,6 +13,7 @@ pacman --noconfirm -Suy
 
 pacman --noconfirm -S --needed \
     base-devel \
+    lcov \
     mingw-w64-$MSYS2_ARCH-ccache \
     mingw-w64-$MSYS2_ARCH-gettext \
     mingw-w64-$MSYS2_ARCH-libffi \
@@ -24,12 +25,6 @@ pacman --noconfirm -S --needed \
     mingw-w64-$MSYS2_ARCH-zlib \
     mingw-w64-$MSYS2_ARCH-libelf
 
-curl -O -J -L "https://github.com/linux-test-project/lcov/releases/download/v1.14/lcov-1.14.tar.gz";
-echo "14995699187440e0ae4da57fe3a64adc0a3c5cf14feab971f8db38fb7d8f071a  lcov-1.14.tar.gz" | sha256sum -c
-tar -xzf lcov-1.14.tar.gz
-# FIXME: not currently using lcov, see below
-#LCOV="$(pwd)/lcov-1.14/bin/lcov"
-
 mkdir -p _coverage
 mkdir -p _ccache
 CCACHE_BASEDIR="$(pwd)"
@@ -47,15 +42,13 @@ meson --werror --buildtype debug _build
 cd _build
 ninja
 
-# FIXME: lcov doesn't support gcc9 yet:
-# https://github.com/linux-test-project/lcov/issues/58
-#"${LCOV}" \
-#    --quiet \
-#    --config-file "${DIR}"/.gitlab-ci/lcovrc \
-#    --directory "${DIR}/_build" \
-#    --capture \
-#    --initial \
-#    --output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
+lcov \
+    --quiet \
+    --config-file "${DIR}"/.gitlab-ci/lcovrc \
+    --directory "${DIR}/_build" \
+    --capture \
+    --initial \
+    --output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
 
 # FIXME: fix the test suite
 meson test --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" --no-suite flaky || true
@@ -66,10 +59,9 @@ python3 "${DIR}"/.gitlab-ci/meson-junit-report.py \
         --output "${DIR}/_build/${CI_JOB_NAME}-report.xml" \
         "${DIR}/_build/meson-logs/testlog.json"
 
-# FIXME: see above
-#"${LCOV}" \
-#    --quiet \
-#    --config-file "${DIR}"/.gitlab-ci/lcovrc \
-#    --directory "${DIR}/_build" \
-#    --capture \
-#    --output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"
+lcov \
+    --quiet \
+    --config-file "${DIR}"/.gitlab-ci/lcovrc \
+    --directory "${DIR}/_build" \
+    --capture \
+    --output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"


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