Respect TMPDIR in test run script

This commit is contained in:
Maxime Coste 2016-12-17 10:26:37 +00:00
parent cf10f3f0a0
commit f200079069

View File

@ -7,7 +7,8 @@ main() {
number_failures=0 number_failures=0
dirs="${@:-.}" dirs="${@:-.}"
test=$(pwd) test=$(pwd)
work=$(mktemp -d /tmp/kak-tests.XXXXXXXX) tmpdir="${TMPDIR:-/tmp}"
work=$(mktemp -d ${tmpdir}/kak-tests.XXXXXXXX)
trap "rm -R $work" EXIT trap "rm -R $work" EXIT
for dir in $(find $dirs -type d | sort); do for dir in $(find $dirs -type d | sort); do
cd $test/$dir; cd $test/$dir;
@ -52,7 +53,7 @@ main() {
quit! quit!
" "
session="kak-tests" session="kak-tests"
rm -f /tmp/kakoune/$USER/$session rm -f ${tmpdir}/kakoune/$USER/$session
${test}/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > display ${test}/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > display
retval=$? retval=$?
if [ $should_fail -eq 0 ]; then if [ $should_fail -eq 0 ]; then