Codebase list libsdl2-mixer / dacb636
Add a superficial autopkgtest for libsdl2-mixer-dev This builds the two example programs, playmus and playwave, and runs them with the dummy audio backend. It doesn't provide much coverage, but does at least demonstrate that the -dev package is working correctly, without missing dependencies. Signed-off-by: Simon McVittie <smcv@collabora.com> Simon McVittie authored 4 years ago Felix Geyer committed 4 years ago
2 changed file(s) with 39 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 Tests: libsdl2-mixer-dev
1 Restrictions: allow-stderr, superficial
2 Depends:
3 alsa-utils,
4 libsdl2-mixer-dev,
5 xauth,
6 xvfb,
0 #!/bin/sh
1 # Copyright 2019 Collabora Ltd.
2 # SPDX-License-Identifier: Zlib
3 # (see "zlib/libpng" in debian/copyright)
4
5 set -eux
6
7 if [ -n "${AUTOPKGTEST_ARTIFACTS-}" ]; then
8 WORKDIR="$AUTOPKGTEST_ARTIFACTS"
9 else
10 WORKDIR="$(mktemp -d)"
11 trap 'cd /; rm -fr "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM
12 fi
13
14 export SDL_AUDIODRIVER=dummy
15
16 cp playmus.c "$WORKDIR"
17 cp playwave.c "$WORKDIR"
18
19 cd "$WORKDIR"
20
21 # Deliberately word-splitting pkg-config's output:
22 # shellcheck disable=SC2046
23 gcc -oplaymus playmus.c $(pkg-config --cflags --libs SDL2_mixer)
24 # shellcheck disable=SC2046
25 gcc -oplaywave playwave.c $(pkg-config --cflags --libs SDL2_mixer)
26
27 set -- xvfb-run -a
28
29 # This audio file is shipped in the alsa-utils package
30 "$@" ./playmus /usr/share/sounds/alsa/Front_Center.wav
31 "$@" ./playwave /usr/share/sounds/alsa/Front_Center.wav