summaryrefslogtreecommitdiffstats
path: root/subprojects/libhandy/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/libhandy/debian/tests')
-rwxr-xr-xsubprojects/libhandy/debian/tests/build-test30
-rw-r--r--subprojects/libhandy/debian/tests/control8
-rwxr-xr-xsubprojects/libhandy/debian/tests/python-gi-test13
3 files changed, 51 insertions, 0 deletions
diff --git a/subprojects/libhandy/debian/tests/build-test b/subprojects/libhandy/debian/tests/build-test
new file mode 100755
index 0000000..434a846
--- /dev/null
+++ b/subprojects/libhandy/debian/tests/build-test
@@ -0,0 +1,30 @@
+#!/bin/sh
+set -eu
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+ CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
+else
+ CROSS_COMPILE=
+fi
+
+cd "$AUTOPKGTEST_TMP"
+
+cat <<EOF > handytest.c
+#include <gtk/gtk.h>
+#include <handy.h>
+
+int
+main (int argc,
+ char **argv)
+{
+ gtk_init(&argc, &argv);
+ hdy_init();
+ hdy_keypad_new(FALSE, TRUE);
+}
+EOF
+
+${CROSS_COMPILE}gcc -o handytest handytest.c $(${CROSS_COMPILE}pkg-config --cflags --libs libhandy-1)
+echo "build ok"
+[ -x handytest ]
+xvfb-run -a -s "-screen 0 1024x768x24" ./handytest
+echo "starts ok"
diff --git a/subprojects/libhandy/debian/tests/control b/subprojects/libhandy/debian/tests/control
new file mode 100644
index 0000000..595abee
--- /dev/null
+++ b/subprojects/libhandy/debian/tests/control
@@ -0,0 +1,8 @@
+Tests: build-test
+Depends: libhandy-1-dev, build-essential, pkg-config, xauth, xvfb
+Restrictions: allow-stderr
+
+Tests: python-gi-test
+Depends: gir1.2-handy-1, python3-gi, python3
+Restrictions: allow-stderr
+
diff --git a/subprojects/libhandy/debian/tests/python-gi-test b/subprojects/libhandy/debian/tests/python-gi-test
new file mode 100755
index 0000000..dfb1bf3
--- /dev/null
+++ b/subprojects/libhandy/debian/tests/python-gi-test
@@ -0,0 +1,13 @@
+#!/usr/bin/python3
+#
+# Make sure gobject introspection works
+
+import gi
+
+gi.require_version('Handy', '1')
+from gi.repository import Handy
+
+group = Handy.SwipeGroup()
+
+assert type(group).__name__ == 'SwipeGroup'
+assert group.get_swipeables() == []