From: Simon McVittie Date: Wed, 26 Aug 2020 09:16:11 +0000 (+0100) Subject: Add superficial smoke-tests for the library and GIR data X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~50 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=20c5c42de4450e23721ea2df0803bd9272433814;p=babl.git Add superficial smoke-tests for the library and GIR data --- diff --git a/debian/copyright b/debian/copyright index 5e73e15..4c39118 100644 --- a/debian/copyright +++ b/debian/copyright @@ -29,7 +29,9 @@ License: GPL-3+ with GGGL exception Files: debian/* Copyright: 2007, Étienne Bersac 2012, Matteo F. Vescovi -License: LGPL-3+ + 2020 Collabora Ltd. + 2020 Simon McVittie +License: LGPL-3+ and Expat License: Expat SPDX-License-Identifier: MIT diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..99b1574 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,7 @@ +Tests: libbabl-dev +Depends: build-essential, pkg-config, libbabl-dev +Restrictions: allow-stderr, superficial + +Tests: gir1.2-babl-0.1 +Depends: gir1.2-babl-0.1, python3-gi +Restrictions: allow-stderr, superficial diff --git a/debian/tests/gir1.2-babl-0.1 b/debian/tests/gir1.2-babl-0.1 new file mode 100755 index 0000000..c4ae698 --- /dev/null +++ b/debian/tests/gir1.2-babl-0.1 @@ -0,0 +1,14 @@ +#!/usr/bin/python3 +# Copyright 2020 Simon McVittie +# SPDX-License-Identifier: MIT + +import os + +import gi +gi.require_version('Babl', '0.1') + +from gi.repository import Babl + +if __name__ == '__main__': + triple = Babl.get_version() + assert tuple(triple) >= (0, 1) diff --git a/debian/tests/libbabl-dev b/debian/tests/libbabl-dev new file mode 100755 index 0000000..13bb908 --- /dev/null +++ b/debian/tests/libbabl-dev @@ -0,0 +1,37 @@ +#!/bin/sh +# Copyright 2020 Collabora Ltd. +# SPDX-License-Identifier: MIT + +set -eux + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CROSS_COMPILE="$DEB_HOST_GNU_TYPE-" +else + CROSS_COMPILE= +fi + +cd "$AUTOPKGTEST_TMP" + +cat > trivial.c < + +#undef NDEBUG +#include + +int main(void) +{ + int x, y, z; + + babl_get_version(&x, &y, &z); + assert(x >= 0); + assert(y >= 0); + assert(z >= 0); + assert((x * 1000) + y >= 1); + return 0; +} +EOF + +# Deliberately word-splitting pkg-config's output: +# shellcheck disable=SC2046 +"${CROSS_COMPILE}gcc" -otrivial trivial.c $("${CROSS_COMPILE}pkg-config" --cflags --libs babl) +./trivial