#!/bin/sh
# autopkgtest check: Build and run a program against ign-transport, to verify that the
# headers and pkg-config file are installed correctly
# (C) 2012 Jose Luis Rivero
# Author: Jose Luis Rivero <jrivero@osrfoundation.org>

set -e

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
cat <<EOF > igntest.c
#include <ignition/transport.hh>

int main()
{
    // Create a transport node.
    ignition::transport::Uuid uuid;
    return 0;
}
EOF

g++ -o igntest igntest.c `pkg-config --cflags --libs ignition-transport4`
echo "build: OK"
[ -x igntest ]
./igntest
echo "run: OK"
