#!/bin/sh

set -e
set -u
set -x

test -d "$AUTOPKGTEST_TMP"
test "$(echo "$AUTOPKGTEST_TMP"/*)" = "$AUTOPKGTEST_TMP/*"

# this could be anything, it's just some random file to use as the "secret"
echo "it's a secret to everybody!" > "$AUTOPKGTEST_TMP"/libtool

# the test script is designed to be used uninstalled
ln -s "$(command -v gfsplit)" "$AUTOPKGTEST_TMP"/gfsplit
ln -s "$(command -v gfcombine)" "$AUTOPKGTEST_TMP"/gfcombine
install tests/test_gfsplit_gfcombine.sh "$AUTOPKGTEST_TMP"/test_gfsplit_gfcombine.sh

cd "$AUTOPKGTEST_TMP"
exec sh -x ./test_gfsplit_gfcombine.sh
