mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Merge branch 'ci-coverage-include-baseline' into 'master'
CI: Include coverage data of code which isn't executed by the test suite. See merge request GNOME/glib!152
This commit is contained in:
commit
7c8aaa7e0d
@ -21,9 +21,10 @@ fedora-x86_64:
|
|||||||
script:
|
script:
|
||||||
- meson --buildtype debug --werror -Dsystemtap=true -Ddtrace=true -Dfam=true _build .
|
- meson --buildtype debug --werror -Dsystemtap=true -Ddtrace=true -Dfam=true _build .
|
||||||
- ninja -C _build
|
- ninja -C _build
|
||||||
- meson test -C _build --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER}
|
|
||||||
- mkdir -p _coverage
|
- mkdir -p _coverage
|
||||||
- lcov --rc lcov_branch_coverage=1 --directory . --capture --no-external --output-file "_coverage/${CI_JOB_NAME}.lcov"
|
- lcov --rc lcov_branch_coverage=1 --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
|
||||||
|
- meson test -C _build --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER}
|
||||||
|
- lcov --rc lcov_branch_coverage=1 --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||||
when: always
|
when: always
|
||||||
|
@ -5,9 +5,11 @@ set -e
|
|||||||
# Fixup Windows paths
|
# Fixup Windows paths
|
||||||
python3 ./.gitlab-ci/fixup-cov-paths.py _coverage/*.lcov
|
python3 ./.gitlab-ci/fixup-cov-paths.py _coverage/*.lcov
|
||||||
|
|
||||||
# Remove coverage from generated code in the build directory
|
|
||||||
for path in _coverage/*.lcov; do
|
for path in _coverage/*.lcov; do
|
||||||
|
# Remove coverage from generated code in the build directory
|
||||||
lcov --rc lcov_branch_coverage=1 -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
|
lcov --rc lcov_branch_coverage=1 -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
|
||||||
|
# Remove any coverage from system files
|
||||||
|
lcov --rc lcov_branch_coverage=1 -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
|
||||||
done
|
done
|
||||||
|
|
||||||
genhtml \
|
genhtml \
|
||||||
|
@ -23,29 +23,38 @@ pacman --noconfirm -S --needed \
|
|||||||
mingw-w64-$MSYS2_ARCH-toolchain \
|
mingw-w64-$MSYS2_ARCH-toolchain \
|
||||||
mingw-w64-$MSYS2_ARCH-zlib
|
mingw-w64-$MSYS2_ARCH-zlib
|
||||||
|
|
||||||
|
curl -O -J -L "https://github.com/linux-test-project/lcov/releases/download/v1.13/lcov-1.13.tar.gz"
|
||||||
|
echo "44972c878482cc06a05fe78eaa3645cbfcbad6634615c3309858b207965d8a23 lcov-1.13.tar.gz" | sha256sum -c
|
||||||
|
tar -xzf lcov-1.13.tar.gz
|
||||||
|
LCOV="$(pwd)/lcov-1.13/bin/lcov"
|
||||||
|
|
||||||
|
mkdir -p _coverage
|
||||||
mkdir -p _ccache
|
mkdir -p _ccache
|
||||||
export CCACHE_BASEDIR="$(pwd)"
|
export CCACHE_BASEDIR="$(pwd)"
|
||||||
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
||||||
pip3 install --upgrade --user meson==0.47.0
|
pip3 install --upgrade --user meson==0.47.0
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
|
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
|
||||||
|
DIR="$(pwd)"
|
||||||
|
|
||||||
meson --werror --buildtype debug _build
|
meson --werror --buildtype debug _build
|
||||||
cd _build
|
cd _build
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
|
"${LCOV}" \
|
||||||
|
--quiet \
|
||||||
|
--rc lcov_branch_coverage=1 \
|
||||||
|
--directory "${DIR}/_build" \
|
||||||
|
--capture \
|
||||||
|
--initial \
|
||||||
|
--output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
|
||||||
|
|
||||||
# FIXME: fix the test suite
|
# FIXME: fix the test suite
|
||||||
meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER} || true
|
meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER} || true
|
||||||
|
|
||||||
cd ..
|
"${LCOV}" \
|
||||||
curl -O -J -L "https://github.com/linux-test-project/lcov/releases/download/v1.13/lcov-1.13.tar.gz"
|
--quiet \
|
||||||
echo "44972c878482cc06a05fe78eaa3645cbfcbad6634615c3309858b207965d8a23 lcov-1.13.tar.gz" | sha256sum -c
|
|
||||||
tar -xvzf lcov-1.13.tar.gz
|
|
||||||
|
|
||||||
mkdir -p _coverage
|
|
||||||
./lcov-1.13/bin/lcov \
|
|
||||||
--rc lcov_branch_coverage=1 \
|
--rc lcov_branch_coverage=1 \
|
||||||
--directory . \
|
--directory "${DIR}/_build" \
|
||||||
--capture \
|
--capture \
|
||||||
--no-external \
|
--output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"
|
||||||
--output-file "_coverage/${CI_JOB_NAME}.lcov"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user