diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-11 16:33:05 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-09-12 11:26:41 -0400 |
commit | eeba3ea0411078424d8f0d127d792618c2a929d3 (patch) | |
tree | 6d69d70e09c64eed4f95c461823e1af2fa1c99bd /test/test-common.sh | |
parent | bd2b16fbbe43e5d879ee85da7259bdd649e4394e (diff) |
test: tidy up, make everything use test-common.sh
Diffstat (limited to 'test/test-common.sh')
-rw-r--r-- | test/test-common.sh | 8 |
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; |