#!/bin/sh
# based on salsa.d.o/re2c/d/t/upstream-runtests
set -e -u

cp --verbose --archive tests/ "$AUTOPKGTEST_TMP"

cd "$AUTOPKGTEST_TMP"

# symlink the packaged gpscorrelate executable
ln --verbose --symbolic /usr/bin/gpscorrelate "$AUTOPKGTEST_TMP"

cd tests/

if [ $(command -v valgrind) ]; then
	./testsuite -m
else
	./testsuite
fi
