summaryrefslogtreecommitdiff
path: root/data/cwidget/debian/tests/compile-example-testcwidget
diff options
context:
space:
mode:
Diffstat (limited to 'data/cwidget/debian/tests/compile-example-testcwidget')
-rw-r--r--data/cwidget/debian/tests/compile-example-testcwidget27
1 files changed, 27 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"