diff --git a/debian/changelog b/debian/changelog index 93bf35e..efb192e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +libsdl2-ttf (2.0.15+dfsg1-2) UNRELEASED; urgency=medium + + * Add an autopkgtest smoke-test, thanks to Simon McVittie for the patch. + (Closes: #941024) + + -- Felix Geyer Mon, 09 Dec 2019 18:26:58 +0100 + libsdl2-ttf (2.0.15+dfsg1-1) unstable; urgency=medium * Team upload. diff --git a/debian/copyright b/debian/copyright index 798b66d..d18716c 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,6 +11,11 @@ Files: debian/* Copyright: 2012-2013, Manuel A. Fernandez Montecelo +License: zlib/libpng + + +Files: debian/tests/* +Copyright: 2019 Collabora Ltd. License: zlib/libpng diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..fb73f1e --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,9 @@ +Tests: libsdl2-ttf-dev +Restrictions: allow-stderr, superficial +Depends: + build-essential, + file, + fonts-cantarell, + libsdl2-ttf-dev, + xauth, + xvfb, diff --git a/debian/tests/libsdl2-ttf-dev b/debian/tests/libsdl2-ttf-dev new file mode 100755 index 0000000..0fbf55e --- /dev/null +++ b/debian/tests/libsdl2-ttf-dev @@ -0,0 +1,36 @@ +#!/bin/sh +# Copyright 2019 Collabora Ltd. +# SPDX-License-Identifier: Zlib +# (see "zlib/libpng" in debian/copyright) + +set -eux + +if [ -n "${AUTOPKGTEST_ARTIFACTS-}" ]; then + WORKDIR="$AUTOPKGTEST_ARTIFACTS" +else + WORKDIR="$(mktemp -d)" + trap 'cd /; rm -fr "$WORKDIR"' 0 INT QUIT ABRT PIPE TERM +fi + +cp showfont.c "$WORKDIR" + +cd "$WORKDIR" + +# Deliberately word-splitting pkg-config's output: +# shellcheck disable=SC2046 +gcc -oshowfont showfont.c $(pkg-config --cflags --libs SDL2_ttf) + +set -- ./showfont + +if [ -z "${TEST_INTERACTIVE-}" ]; then + echo "(export TEST_INTERACTIVE=1 for an interactive test)" + set -- xvfb-run -a "$@" -dump +fi + +set -- "$@" /usr/share/fonts/opentype/cantarell/Cantarell-Regular.otf + +"$@" + +if [ -z "${TEST_INTERACTIVE-}" ]; then + file glyph-100.bmp +fi