mirror of
https://github.com/flatpak/flatpak.git
synced 2025-12-31 11:58:03 -05:00
There is no need for these files to be generated on disk Closes: #2170 Approved by: alexlarsson
25 lines
572 B
Bash
Executable File
25 lines
572 B
Bash
Executable File
#! /bin/bash
|
|
#
|
|
# Run a test in tap mode, ensuring we have a temporary directory.
|
|
#
|
|
# The test binary is passed as $1
|
|
|
|
srcd=$(cd $(dirname $1) && pwd)
|
|
bn=$(basename $1)
|
|
tempdir=$(mktemp -d /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}
|
|
if [[ $bn == *.wrap ]]; then
|
|
WRAPPER=${srcd}/test-wrapper.sh
|
|
fi
|
|
$WRAPPER ${srcd}/${bn} -k --tap
|