summaryrefslogtreecommitdiff
path: root/test/test-common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/test-common.sh')
-rw-r--r--test/test-common.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test-common.sh b/test/test-common.sh
index 85c05c5..01b1b35 100644
--- a/test/test-common.sh
+++ b/test/test-common.sh
@@ -6,11 +6,15 @@ if [[ $HOME == "$(eval echo ~$USER)" ]]; then
fi
_before() {
- tmpdir="$(mktemp -d --tmpdir "test-$1.XXXXXXXXXXXX")"
+ tmpdir="$(mktemp -d --tmpdir "test-${roundup_desc//\//-}.XXXXXXXXXXXX")"
stat=0
}
_after() {
+ rm -rf -- "$tmpdir" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME"
+}
+
+_after_sudo() {
if [[ $SUDO ]]; then
sudo rm -rf -- "$tmpdir" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME"
else
@@ -27,7 +31,7 @@ require() {
missing+=('sudo')
fi
if (( ${#missing[@]} )); then
- libremessages warning "Next test requires %s; Skipping (passing)..." "$(echo "${missing[@]}"|sed 's/ /, /g')" &>/dev/tty
+ libremessages warning "Next test requires %s; Skipping (passing)..." "$(echo "${missing[*]}"|sed 's/ /, /g')" &>/dev/tty
return 1
fi
return 0;