summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests')
-rw-r--r--debian/tests/control5
-rwxr-xr-xdebian/tests/testsuite.sh16
2 files changed, 21 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..a2e5842
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+# the tests depend on the kernel and might break the env
+# therefore do not run as build time tests
+Tests: testsuite.sh
+Restrictions: allow-stderr, isolation-machine, needs-root, rw-build-tree
+Depends: build-essential, locales-all, dpkg-dev, sudo:native, kmod, @builddeps@
diff --git a/debian/tests/testsuite.sh b/debian/tests/testsuite.sh
new file mode 100755
index 0000000..5c421ea
--- /dev/null
+++ b/debian/tests/testsuite.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -uxe
+
+if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
+ vars="CC=$DEB_HOST_GNU_TYPE-gcc LD=$DEB_HOST_GNU_TYPE-ld"
+else
+ vars=""
+fi
+
+# copy built-tree to tmp test dir to gurantee no files are left behind
+dir=$(mktemp -d)
+cp -a . "${dir}"
+cd "${dir}"
+
+# build and run tests
+make $vars check