#!/bin/bash
set -e

pkg=libconcurrentqueue-dev

if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"

function test_output()
{
	echo "Test $1"
	g++ $2 -lpthread -o test
	./test
	echo "PASS"
}

test_output 1 test1.cpp
test_output 2 test2.cpp
test_output 3 test3.cpp

