Debian Codegraph @

buildutil/tap-test

raw symbols SCIP
1 #! /bin/bash
2 #
3 # Run a test in tap mode, ensuring we have a temporary directory. We
4 # always use /var/tmp because we might want to use user xattrs, which
5 # aren't available on tmpfs.
6 #
7 # The test binary is passed as $1
8
9 srcd=$(cd $(dirname $1) && pwd)
10 bn=$(basename $1)
11 tempdir=$(mktemp -d /var/tmp/tap-test.XXXXXX)
12 touch ${tempdir}/.testtmp
13 function cleanup () {
14 if test -n "${TEST_SKIP_CLEANUP:-}"; then
15 echo "Skipping cleanup of ${tempdir}"
16 else if test -f ${tempdir}/.testtmp; then
17 rm "${tempdir}" -rf
18 fi
19 fi
20 }
21 trap cleanup EXIT
22 cd ${tempdir}
23 ${srcd}/${bn} -k --tap