File: tap-test

package info (click to toggle)
flatpak-builder 1.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,436 kB
  • sloc: ansic: 29,646; sh: 6,649; xml: 1,955; makefile: 170; python: 6
file content (23 lines) | stat: -rwxr-xr-x 588 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/bash
#
# Run a test in tap mode, ensuring we have a temporary directory.  We
# always use /var/tmp because we might want to use user xattrs, which
# aren't available on tmpfs.
#
# The test binary is passed as $1

srcd=$(cd $(dirname $1) && pwd)
bn=$(basename $1)
tempdir=$(mktemp -d /var/tmp/tap-test.XXXXXX)
touch ${tempdir}/.testtmp
function cleanup () {
    if test -n "${TEST_SKIP_CLEANUP:-}"; then
	echo "Skipping cleanup of ${tempdir}"
    else if test -f ${tempdir}/.testtmp; then
	rm "${tempdir}" -rf
    fi
    fi
}
trap cleanup EXIT
cd ${tempdir}
${srcd}/${bn} -k --tap