Debian Codegraph @

debian/tests/upstream-tests

raw
1 #!/bin/sh
2 # autopkgtest check: Build and run the upstream testsuite
3
4 set -ex
5
6 # Require $AUTOPKGTEST_TMP for temporary build files
7 if [ -z "$AUTOPKGTEST_TMP" ]
8 then
9 echo "Required envvar \"$AUTOPKGTEST_TMP\"is not set" >&2
10 exit 1
11 fi
12
13 # Build tests
14 CSFML_SOURCE="$PWD"
15 cd "$AUTOPKGTEST_TMP"
16
17 cp "$CSFML_SOURCE/debian/tests/CMakeLists.txt.upstream" CMakeLists.txt
18 cmake . -DCSFML_SOURCE="$CSFML_SOURCE" -DCMAKE_BUILD_TYPE=Debug
19 make "-j$(nproc)" VERBOSE=1
20 echo "build: OK"
21
22 # WIP
23 ctest --verbose
24 echo "tests: OK"
25 exit 0
26
27 # Spawn a dummy X server to run the tests in
28 export DISPLAY=:99
29 cp "$CSFML_SOURCE/debian/tests/xorg-dummy.conf" .
30
31 trap 'kill $XORG_PID' INT TERM EXIT
32 Xorg -noreset -logfile ./xorg.log -config ./xorg-dummy.conf "$DISPLAY" &
33 XORG_PID=$!
34 sleep 1
35
36 # Run the tests
37 # TODO The sf::Window tests fail with the dummy Xorg server because
38 # the server does not present any visuals with MSAA support.
39 # My hunch is it's related to this Mesa MR:
40 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31019
41 ctest --verbose --exclude-regex 'sf::Window$'
42 echo "tests: OK"