summaryrefslogtreecommitdiff
path: root/data/cwidget/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'data/cwidget/debian/tests')
-rw-r--r--data/cwidget/debian/tests/compile-example-testcwidget27
-rw-r--r--data/cwidget/debian/tests/control2
2 files changed, 29 insertions, 0 deletions
diff --git a/data/cwidget/debian/tests/compile-example-testcwidget b/data/cwidget/debian/tests/compile-example-testcwidget
new file mode 100644
index 000000000..a1a5692de
--- /dev/null
+++ b/data/cwidget/debian/tests/compile-example-testcwidget
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Author: Manuel A. Fernandez Montecelo <mafm@debian.org>
+#
+# autopkgtest check: Build and run a program against the library, to verify that
+# the headers and pkg-config file are installed correctly
+
+
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+SRCFILE=testcwidget.cc
+SRCFILEGZ=testcwidget.cc.gz
+BINFILE=testcwidget
+
+gunzip -c /usr/share/doc/libcwidget-dev/examples/$SRCFILEGZ > $SRCFILE
+
+g++ -o $BINFILE $SRCFILE -std=c++11 `pkg-config --cflags --libs cwidget` -I /usr/include/cwidget
+echo "build: OK"
+
+[ -x $BINFILE ]
+# interactive, cannot invoke and close from command line
+#./$BINFILE
+echo "run: OK"
diff --git a/data/cwidget/debian/tests/control b/data/cwidget/debian/tests/control
new file mode 100644
index 000000000..14cc57793
--- /dev/null
+++ b/data/cwidget/debian/tests/control
@@ -0,0 +1,2 @@
+Tests: compile-example-testcwidget
+Depends: libcwidget-dev, build-essential