test-msys2.sh 1.64 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/bash

set -e

export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
if [[ "$MSYSTEM" == "MINGW32" ]]; then
    export MSYS2_ARCH="i686"
else
    export MSYS2_ARCH="x86_64"
fi

pacman --noconfirm -Suy

pacman --noconfirm -S --needed \
    base-devel \
    mingw-w64-$MSYS2_ARCH-ccache \
    mingw-w64-$MSYS2_ARCH-gettext \
    mingw-w64-$MSYS2_ARCH-libffi \
    mingw-w64-$MSYS2_ARCH-meson \
    mingw-w64-$MSYS2_ARCH-pcre \
    mingw-w64-$MSYS2_ARCH-python3 \
Christoph Reiter's avatar
Christoph Reiter committed
22
    mingw-w64-$MSYS2_ARCH-python3-pip \
23
    mingw-w64-$MSYS2_ARCH-toolchain \
24 25
    mingw-w64-$MSYS2_ARCH-zlib \
    mingw-w64-$MSYS2_ARCH-libelf
26

27 28 29 30 31 32
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
33 34 35
mkdir -p _ccache
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
36
pip3 install --upgrade --user meson==0.48.0
Christoph Reiter's avatar
Christoph Reiter committed
37
export PATH="$HOME/.local/bin:$PATH"
38
export CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
39
DIR="$(pwd)"
40

41
meson --werror --buildtype debug _build
42 43 44
cd _build
ninja

45 46
"${LCOV}" \
    --quiet \
47
    --config-file "${DIR}"/.gitlab-ci/lcovrc \
48 49 50 51 52
    --directory "${DIR}/_build" \
    --capture \
    --initial \
    --output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"

53
# FIXME: fix the test suite
54
meson test --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER} || true
55

56 57
"${LCOV}" \
    --quiet \
58
    --config-file "${DIR}"/.gitlab-ci/lcovrc \
59
    --directory "${DIR}/_build" \
60
    --capture \
61
    --output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"