summaryrefslogtreecommitdiff
path: root/data/cwidget/debian/tests/compile-example-testcwidget
blob: a1a5692decee219d6ae349abecf83cfeb68b6942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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"