workflows: Install and run GNOME-style installed-tests This is currently only done for the Linux Autotools build. The CMake build does not add a significant amount of extra test coverage, and Github Workflows run in an environment where `cmake` and `sudo cmake` point to different executables, which makes it awkward to install into /usr/local from CMake. Signed-off-by: Simon McVittie <smcv@collabora.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 717a158..46b9749 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -39,6 +39,7 @@ jobs:
sudo apt-get update
sudo apt-get install \
autoconf \
+ gnome-desktop-testing \
wayland-protocols \
pkg-config \
ninja-build \
@@ -85,7 +86,7 @@ jobs:
run: ./test/versioning.sh
- name: Configure CMake
if: "! matrix.platform.autotools"
- run: cmake -B build -DSDL_TEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON ${{ matrix.platform.flags }}
+ run: cmake -B build -DSDL_TEST=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DSDL_INSTALL_TESTS=ON ${{ matrix.platform.flags }}
- name: Build
if: "! matrix.platform.autotools"
run: cmake --build build/ --config Release
@@ -147,5 +148,23 @@ jobs:
rm -fr DESTDIR-autotools
mkdir DESTDIR-autotools
make -j"${parallel}" -C build-autotools install DESTDIR="${curdir}/DESTDIR-autotools" V=1
+ make -j"${parallel}" -C build-autotools/test install DESTDIR="${curdir}/DESTDIR-autotools" V=1
( cd DESTDIR-autotools; find ) | LC_ALL=C sort -u
make -j"${parallel}" -C build-autotools dist V=1
+ - name: Run installed-tests from Autotools
+ if: "runner.os == 'Linux' && matrix.platform.autotools"
+ run: |
+ set -eu
+ parallel="$(getconf _NPROCESSORS_ONLN)"
+ sudo make -j"${parallel}" -C build-autotools install
+ sudo make -j"${parallel}" -C build-autotools/test install
+ export SDL_TESTS_QUICK=1
+ # We need to set LD_LIBRARY_PATH because it isn't in the default
+ # linker search path. We don't need to set XDG_DATA_DIRS for
+ # ginsttest-runner, because /usr/local/share *is* in the default
+ # search path for that.
+ env --chdir=/ \
+ LD_LIBRARY_PATH=/usr/local/lib \
+ SDL_AUDIODRIVER=dummy \
+ SDL_VIDEODRIVER=dummy \
+ ginsttest-runner --tap SDL2