Package: libqrtr-glib
Version: 1.2.2-1

It would be nicer if the package had autopkgtests testing. The attached patch is adding a trivial build test on the model of the ones used for most GNOME libraries, it ensure that a simple case builds and that the dev isn't missing any depends.

Thanks for considering




diff -Nru libqrtr-glib-1.2.2/debian/changelog libqrtr-glib-1.2.2/debian/changelog
--- libqrtr-glib-1.2.2/debian/changelog	2022-02-19 14:33:19.000000000 +0100
+++ libqrtr-glib-1.2.2/debian/changelog	2022-05-20 17:10:31.000000000 +0200
@@ -1,3 +1,9 @@
+libqrtr-glib (1.2.2-2) UNRELEASED; urgency=medium
+
+  * debian/tests: include a basic autopkgtest for the library
+
+ -- Sebastien Bacher <seb...@debian.org>  Fri, 20 May 2022 17:10:31 +0200
+
 libqrtr-glib (1.2.2-1) unstable; urgency=medium
 
   * New upstream version 1.2.2
diff -Nru libqrtr-glib-1.2.2/debian/tests/build libqrtr-glib-1.2.2/debian/tests/build
--- libqrtr-glib-1.2.2/debian/tests/build	1970-01-01 01:00:00.000000000 +0100
+++ libqrtr-glib-1.2.2/debian/tests/build	2022-05-20 17:10:31.000000000 +0200
@@ -0,0 +1,31 @@
+#!/bin/sh
+# autopkgtest check: Build and run a program against libqrtr-glib, to verify that
+# the headers and pkg-config file are installed correctly
+
+set -e
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+    CROSS_COMPILE=
+fi
+
+cat <<EOF > libqrtr-glib_test.c
+#include <stdio.h>
+#include <libqrtr-glib/qrtr-version.h>
+
+int main(void)
+{
+  printf("The micro version is %d\n", QRTR_MICRO_VERSION);
+  return 0;
+}
+EOF
+
+# deliberately word-splitting pkg-config output:
+# shellcheck disable=SC2046
+"${CROSS_COMPILE}gcc" -o libqrtr-glib_test libqrtr-glib_test.c \
+$("${CROSS_COMPILE}pkg-config" --cflags --libs qrtr-glib)
+echo "build: OK"
+[ -x libqrtr-glib_test ]
+./libqrtr-glib_test
+echo "run: OK"
diff -Nru libqrtr-glib-1.2.2/debian/tests/control libqrtr-glib-1.2.2/debian/tests/control
--- libqrtr-glib-1.2.2/debian/tests/control	1970-01-01 01:00:00.000000000 +0100
+++ libqrtr-glib-1.2.2/debian/tests/control	2022-05-20 17:10:31.000000000 +0200
@@ -0,0 +1,3 @@
+Tests: build
+Depends: build-essential, pkg-config, libqrtr-glib-dev
+Restrictions: allow-stderr superficial

Reply via email to