#!/bin/sh
# autopkgtest check: Build and run a program against glib, to verify that the
# headers and pkg-config file are installed correctly
# (C) 2015 Wolfgang Fuetterer
# Author: Wolfgang Fuetterer <debian@wlf-online.de>

set -e

CUR_WORKDIR=`pwd`
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cp $CUR_WORKDIR/src/snlTest.cpp $WORKDIR

g++ -Wno-error=template-body -I/usr/include snlTest.cpp -o snlTest -lSNL

echo "build: OK"
[ -x snlTest ]
./snlTest
echo "run: OK"
