diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/testenv | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/testenv b/test/testenv index 131eed2..0c8c4a7 100755 --- a/test/testenv +++ b/test/testenv @@ -1,7 +1,9 @@ #!/bin/bash +export TMPDIR="$(mktemp --tmpdir -d libretools-test.XXXXXXXXXX)" +trap "rm -rf '$TMPDIR'" EXIT # Set up the install to work with -destdir=$(mktemp --tmpdir -d libretools-test-destdir.XXXXXXXXXX) +destdir=$TMPDIR/destdir make -C .. install DESTDIR=$destdir &>/dev/null || { echo 'error creating local install, cannot run tests' exit 1 @@ -10,7 +12,7 @@ export PATH="$destdir/usr/bin:$destdir/usr/sbin:$PATH" export LIBRETOOLS_LIBDIR="$destdir/usr/lib/libretools" # Set up the user profile -home=$(mktemp --tmpdir -d libretools-test-home.XXXXXXXXXX) +home=$TMPDIR/home export XDG_CACHE_HOME="$home/.cache" export XDG_CONFIG_HOME="$home/.config" @@ -19,5 +21,4 @@ eval "$@" ret=$? # Clean up -rm -rf -- "$destdir" "$testhome" exit $ret |