summaryrefslogtreecommitdiffstats
path: root/subprojects/libhandy/debian/tests/build-test
blob: 434a846012a1cc82b57b6a6d38a96ff3f82e1363 (plain)
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
#!/bin/sh
set -eu

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
    CROSS_COMPILE=
fi

cd "$AUTOPKGTEST_TMP"

cat <<EOF > handytest.c
#include <gtk/gtk.h>
#include <handy.h>

int
main (int    argc,
      char **argv)
{
	gtk_init(&argc, &argv);
	hdy_init();
	hdy_keypad_new(FALSE, TRUE);
}
EOF

${CROSS_COMPILE}gcc -o handytest handytest.c $(${CROSS_COMPILE}pkg-config --cflags --libs libhandy-1)
echo "build ok"
[ -x handytest ]
xvfb-run -a -s "-screen 0 1024x768x24" ./handytest
echo "starts ok"