Updated patch, setting '-eu' mode so the test fails if one of the command errors out
diff -Nru libhandy-0.0.12/debian/changelog libhandy-0.0.12/debian/changelog --- libhandy-0.0.12/debian/changelog 2019-12-12 09:49:04.000000000 +0100 +++ libhandy-0.0.12/debian/changelog 2019-12-13 15:07:06.000000000 +0100 @@ -1,3 +1,14 @@ +libhandy (0.0.12-2) UNRELEASED; urgency=medium + + * debian/tests: + update the build test to closer from other GNOME ones + and fix some issues/the current test failing + - don't use a deprecated function + - handle cross build autopkgtest environment + - include a runtime test as well + + -- Sebastien Bacher <seb...@ubuntu.com> Fri, 13 Dec 2019 13:17:01 +0100 + libhandy (0.0.12-1) unstable; urgency=medium * New upstream version 0.0.12 diff -Nru libhandy-0.0.12/debian/tests/build-test libhandy-0.0.12/debian/tests/build-test --- libhandy-0.0.12/debian/tests/build-test 2019-04-23 12:40:50.000000000 +0200 +++ libhandy-0.0.12/debian/tests/build-test 2019-12-13 15:17:15.000000000 +0100 @@ -1,9 +1,29 @@ -#!/usr/bin/make -f +#!/bin/sh +set -eu -CFLAGS=$(shell pkg-config --cflags libhandy-0.0) -LIBS=$(shell pkg-config --libs libhandy-0.0) +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" +else + CROSS_COMPILE= +fi -a.out: debian/tests/build-test.c - gcc $(CFLAGS) $< $(LIBS) - @echo "Build test of $< succeeded" - @rm -f a.out +cd "$AUTOPKGTEST_TMP" + +cat <<EOF > handytest.c +#include <gtk/gtk.h> +#define HANDY_USE_UNSTABLE_API +#include <handy.h> + +int +main (int argc, + char **argv) +{ + hdy_init(&argc, &argv); +} +EOF + +${CROSS_COMPILE}gcc -o handytest handytest.c $(${CROSS_COMPILE}pkg-config --cflags --libs libhandy-0.0) +echo "build ok" +[ -x handytest ] +xvfb-run -a -s "-screen 0 1024x768x24" ./handytest +echo "starts ok" diff -Nru libhandy-0.0.12/debian/tests/build-test.c libhandy-0.0.12/debian/tests/build-test.c --- libhandy-0.0.12/debian/tests/build-test.c 2019-10-25 21:01:06.000000000 +0200 +++ libhandy-0.0.12/debian/tests/build-test.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -#include <gtk/gtk.h> -#define HANDY_USE_UNSTABLE_API -#include <handy.h> - -int -main (int argc, - char **argv) -{ - hdy_dialer_new (); -} diff -Nru libhandy-0.0.12/debian/tests/control libhandy-0.0.12/debian/tests/control --- libhandy-0.0.12/debian/tests/control 2019-10-25 21:01:06.000000000 +0200 +++ libhandy-0.0.12/debian/tests/control 2019-12-13 14:59:16.000000000 +0100 @@ -1,5 +1,5 @@ Tests: build-test -Depends: libhandy-0.0-dev, build-essential, pkg-config +Depends: libhandy-0.0-dev, build-essential, pkg-config, xauth, xvfb Restrictions: allow-stderr Tests: python-gi-test