Meson: Install glib tests
[glib.git] / .gitlab-ci / test-msys2.sh
blobd8891e35b4320863453bfbabe19e4ae07be7989a
1 #!/bin/bash
3 set -e
5 export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
6 if [[ "$MSYSTEM" == "MINGW32" ]]; then
7 export MSYS2_ARCH="i686"
8 else
9 export MSYS2_ARCH="x86_64"
12 pacman --noconfirm -Suy
14 pacman --noconfirm -S --needed \
15 base-devel \
16 mingw-w64-$MSYS2_ARCH-ccache \
17 mingw-w64-$MSYS2_ARCH-gettext \
18 mingw-w64-$MSYS2_ARCH-libffi \
19 mingw-w64-$MSYS2_ARCH-meson \
20 mingw-w64-$MSYS2_ARCH-pcre \
21 mingw-w64-$MSYS2_ARCH-python3 \
22 mingw-w64-$MSYS2_ARCH-python3-pip \
23 mingw-w64-$MSYS2_ARCH-toolchain \
24 mingw-w64-$MSYS2_ARCH-zlib
26 curl -O -J -L "https://github.com/linux-test-project/lcov/releases/download/v1.13/lcov-1.13.tar.gz"
27 echo "44972c878482cc06a05fe78eaa3645cbfcbad6634615c3309858b207965d8a23 lcov-1.13.tar.gz" | sha256sum -c
28 tar -xzf lcov-1.13.tar.gz
29 LCOV="$(pwd)/lcov-1.13/bin/lcov"
31 mkdir -p _coverage
32 mkdir -p _ccache
33 export CCACHE_BASEDIR="$(pwd)"
34 export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
35 pip3 install --upgrade --user meson==0.47.0
36 export PATH="$HOME/.local/bin:$PATH"
37 export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
38 DIR="$(pwd)"
40 meson --werror --buildtype debug _build
41 cd _build
42 ninja
44 "${LCOV}" \
45 --quiet \
46 --rc lcov_branch_coverage=1 \
47 --directory "${DIR}/_build" \
48 --capture \
49 --initial \
50 --output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
52 # FIXME: fix the test suite
53 meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER} || true
55 "${LCOV}" \
56 --quiet \
57 --rc lcov_branch_coverage=1 \
58 --directory "${DIR}/_build" \
59 --capture \
60 --output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"