Debian Codegraph @

debian/tests/build

raw
1 #!/bin/sh
2
3 # autopkgtest check: Build and run a program against libspeexdsp,
4 # to verify that the headers and pkg-config file are installed correctly.
5
6 set -eu
7
8 if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
9 CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
10 else
11 CROSS_COMPILE=
12 fi
13
14 cat <<EOF > libspeexdsp_test.c
15 #include <stddef.h>
16 #include <speex/speex_resampler.h>
17
18 int main(void)
19 {
20 SpeexResamplerState *st = speex_resampler_init(1, 48000, 48000, 4, NULL);
21
22 return 0;
23 }
24 EOF
25
26 # deliberately word-splitting pkg-config output:
27 # shellcheck disable=SC2046
28 "${CROSS_COMPILE}gcc" -o libspeexdsp_test libspeexdsp_test.c \
29 $("${CROSS_COMPILE}pkg-config" --cflags --libs speexdsp)
30 echo "build: OK"
31 [ -x libspeexdsp_test ]
32 ./libspeexdsp_test
33 echo "run: OK"