#!/bin/sh

# testscript to run libcommuni unit tests.
# Part of the Debian package for libcommuni

set -e

# copying source as the build is in-source.
WORKDIR=$(mktemp -d)
echo "this is our $WORKDIR"

trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM

# Copy the source tree
cp -r . "$WORKDIR" ; cd "$WORKDIR"

# Build it and run tests.
./configure --nomake examples --nomake qml

# build only the tests and run them.
# This will make sure the libs from the package are used.:
cd tests
make check -j $(nproc)

