Merge branch 'add-back-win32-coverage' into 'master'

CI: Re-enable code coverage reporting for MSYS2 builds

See merge request GNOME/glib!1673
This commit is contained in:
Philip Withnall 2020-10-01 13:32:51 +00:00
commit a36c98fe83
2 changed files with 16 additions and 27 deletions

View File

@ -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))

View File

@ -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"