run-tests.sh 3.35 KB
Newer Older
Emmanuele Bassi's avatar
Emmanuele Bassi committed
1
2
#!/bin/bash

3
4
set +x
set +e
Emmanuele Bassi's avatar
Emmanuele Bassi committed
5

6
srcdir=$( pwd )
Emmanuele Bassi's avatar
Emmanuele Bassi committed
7
builddir=$1
8
backend=$2
Emmanuele Bassi's avatar
Emmanuele Bassi committed
9

10
# Ignore memory leaks lower in dependencies
11
export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0
12
export G_SLICE=always-malloc
13

14
case "${backend}" in
Benjamin Otte's avatar
Benjamin Otte committed
15
  x11full)
16
17
18
19
20
21
22
23
24
    xvfb-run -a -s "-screen 0 1920x1080x24 -noreset" \
          dbus-run-session \
              mutter --x11 -- \
                  meson test -C ${builddir} \
                        --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
                        --print-errorlogs \
                        --setup=${backend} \
                        --suite=gtk \
                        --no-suite=gsk-compare-broadway
Benjamin Otte's avatar
Benjamin Otte committed
25
26
27
28
29
30
31

    # Store the exit code for the CI run, but always
    # generate the reports
    exit_code=$?
    ;;

  x11bare)
Matthias Clasen's avatar
Matthias Clasen committed
32
    xvfb-run -a -s "-screen 0 1024x768x24 -noreset" \
33
          meson test -C ${builddir} \
34
                --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
35
                --print-errorlogs \
36
                --setup=${backend} \
37
                --suite=gtk \
38
                --no-suite=gsk-compare-broadway
39

40
41
42
43
44
45
46
47
    # Store the exit code for the CI run, but always
    # generate the reports
    exit_code=$?
    ;;

  wayland)
    export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"

48
    weston --backend=headless-backend.so --socket=wayland-5 --idle-time=0 &
49
50
51
52
    compositor=$!
    export WAYLAND_DISPLAY=wayland-5

    meson test -C ${builddir} \
53
                --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
54
55
56
                --print-errorlogs \
                --setup=${backend} \
                --suite=gtk \
57
                --no-suite=gsk-compare-broadway
58
59
60
61
62

    exit_code=$?
    kill ${compositor}
    ;;

Benjamin Otte's avatar
Benjamin Otte committed
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  waylandgles)
    export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"

    weston --backend=headless-backend.so --socket=wayland-6 --idle-time=0 &
    compositor=$!
    export WAYLAND_DISPLAY=wayland-6

    meson test -C ${builddir} \
                --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
                --print-errorlogs \
                --setup=${backend} \
                --suite=gtk \
                --no-suite=gsk-compare-broadway

    exit_code=$?
    kill ${compositor}
    ;;

81
82
83
84
85
86
87
88
  broadway)
    export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"

    ${builddir}/gdk/broadway/gtk4-broadwayd :5 &
    server=$!
    export BROADWAY_DISPLAY=:5

    meson test -C ${builddir} \
89
                --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
90
91
92
                --print-errorlogs \
                --setup=${backend} \
                --suite=gtk \
93
                --no-suite=gsk-compare-opengl
94

Matthias Clasen's avatar
Matthias Clasen committed
95
96
    # don't let Broadway failures fail the run, for now
    exit_code=0
97
98
    kill ${server}
    ;;
Benjamin Otte's avatar
Benjamin Otte committed
99
100
101
102
103
104

  *)
    echo "Failed to add ${backend} to .gitlab-ci/run-tests.sh"
    exit 1
    ;;

105
esac
106

107
108
cd ${builddir}

109
110
$srcdir/.gitlab-ci/meson-junit-report.py \
        --project-name=gtk \
111
        --backend=${backend} \
112
        --job-id="${CI_JOB_NAME}" \
113
114
        --output=report-${backend}.xml \
        meson-logs/testlog-${backend}.json
115
116
$srcdir/.gitlab-ci/meson-html-report.py \
        --project-name=gtk \
117
        --backend=${backend} \
118
        --job-id="${CI_JOB_NAME}" \
119
120
121
        --reftest-output-dir="testsuite/reftests/output/${backend}" \
        --output=report-${backend}.html \
        meson-logs/testlog-${backend}.json
122
123

exit $exit_code