Debian Codegraph @

debian/tests/build

raw
1 #!/bin/sh
2 # autopkgtest check: Build and run a program against libsoup, to verify that
3 # the headers and pkg-config file are installed correctly
4 # (C) 2012 Canonical Ltd.
5 # (C) 2018-2019 Simon McVittie
6 # (C) 2019 Laurent Bigonville
7 # Authors: Martin Pitt, Simon McVittie
8
9 set -eux
10
11 WORKDIR=$(mktemp -d)
12 export XDG_RUNTIME_DIR="$WORKDIR"
13 trap 'rm -rf "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM
14 cd "$WORKDIR"
15 cat <<EOF > gspell.c
16 #include <gspell/gspell.h>
17
18 int main(void)
19 {
20 g_assert_true (gspell_checker_new(NULL));
21 return 0;
22 }
23 EOF
24
25 cflags=-Wno-deprecated-declarations
26 code=gspell.c
27 lib=gspell-1
28
29 gcc $cflags -o "${lib}-test" "${code}" $(pkg-config --cflags --libs "$lib")
30 echo "build ($lib): OK"
31
32 ./${lib}-test
33 echo "run ($lib): OK"