Debian Codegraph @

debian/tests/build

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