mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-01 08:52:18 +01:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -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)) | ||||
|   | ||||
| @@ -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" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user