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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#!/bin/sh
set -eux
# Machine-readable TAP output on stdout (write to fd 3)
# Diagnostics on stderr (write to fd 1 or 2)
exec 3>&1 >&2
pkg=gom-1.0
n_tests=0
ok () {
n_tests=$((n_tests + 1))
echo "ok $n_tests - $*" >&3
}
done_testing () {
echo "1..$n_tests" >&3
}
cd "$AUTOPKGTEST_TMP"
if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
CROSS_COMPILE="${DEB_HOST_GNU_TYPE}-"
else
CROSS_COMPILE=
fi
cat <<EOF > test.c
#include <gom/gom.h>
int main(void)
{
GomAdapter *a = gom_adapter_new ();
g_object_unref (a);
return 0;
}
EOF
# Intentionally word-splitting pkg-config's output:
# shellcheck disable=SC2046
${CROSS_COMPILE}gcc -o ./test test.c $(${CROSS_COMPILE}pkg-config --cflags --libs gom-1.0 gobject-2.0)
ok "build"
[ -x ./test ]
./test
ok "run"
done_testing
# vim:set sw=4 sts=4 et:
|