alsa-utils/axfer/test/run-test-in-tmpdir.sh
Jaroslav Kysela e1551de8dd axfer: test - add run-test-in-tmpdir.sh script
BugLink: https://github.com/alsa-project/alsa-utils/issues/19
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2021-03-06 08:37:16 +01:00

19 lines
307 B
Bash
Executable file

#!/bin/sh
bin="$1"
test -z ${bin} && exit 90
test ! -x ${bin} && exit 91
test -z ${TMPDIR} && exit 92
test ! -d ${TMPDIR} && exit 93
tmp_dir=$(mktemp -d ${TMPDIR}/container-test.XXXXX)
cur_dir=$(pwd)
echo ${tmp_dir}
cd ${tmp_dir}
${cur_dir}/${bin}
retval=$?
cd ${cur_dir}
rm -rf ${tmp_dir}
exit $retval