Browse Source

Run the test suite also as an autopkgtest

Christoph Biedl 6 months ago
parent
commit
5b3533b5bf
2 changed files with 35 additions and 0 deletions
  1. 7 0
      debian/tests/control
  2. 28 0
      debian/tests/run-testsuite

+ 7 - 0
debian/tests/control

@@ -0,0 +1,7 @@
+Tests: run-testsuite
+Depends:
+    @,
+    build-essential,
+    libjansson-dev,
+    libjose-dev,
+    moreutils,

+ 28 - 0
debian/tests/run-testsuite

@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+CFLAGS="$(dpkg-buildflags --get CFLAGS)"
+CPPFLAGS="$(dpkg-buildflags --get CPPFLAGS)"
+LDFLAGS="$(dpkg-buildflags --get LDFLAGS)"
+
+cd tests
+
+export VECTORS='vectors'
+EXIT=0
+
+for f in $(find . -maxdepth 1 -type f -executable | sort) ; do
+    echo "Testing: $(basename "$f")"
+    chronic "$f" || EXIT=1
+done
+
+for f in $(find . -maxdepth 1 -type f -name '*.c' | sort) ; do
+    BN="$(basename "$f")"
+    echo "Compiling: $BN"
+    PROG="${BN%%.c}"
+    cc $CFLAGS $CPPFLAGS $LDFLAGS "$f" -o "$PROG" -ljose -ljansson
+    echo "Testing: $PROG"
+    chronic "./$PROG" || EXIT=1
+done
+
+exit "$EXIT"