tests/run.sh: Use a temporary directory
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
41d81a4501
commit
d8a1b563e7
18
tests/run.sh
18
tests/run.sh
|
@ -60,22 +60,20 @@ XDG_CONFIG_HOME="./"
|
||||||
export LUA_PATH
|
export LUA_PATH
|
||||||
export XDG_CONFIG_HOME
|
export XDG_CONFIG_HOME
|
||||||
|
|
||||||
awesome_log=/tmp/_awesome_test.log
|
|
||||||
echo "awesome_log: $awesome_log"
|
|
||||||
|
|
||||||
cd - >/dev/null
|
cd - >/dev/null
|
||||||
|
|
||||||
|
# Cleanup on errors / aborting.
|
||||||
kill_childs() {
|
cleanup() {
|
||||||
for p in $awesome_pid $xserver_pid; do
|
for p in $awesome_pid $xserver_pid; do
|
||||||
kill -TERM $p 2>/dev/null || true
|
kill -TERM $p 2>/dev/null || true
|
||||||
done
|
done
|
||||||
|
rm -rf $tmp_files || true
|
||||||
}
|
}
|
||||||
# Cleanup on errors / aborting.
|
trap "cleanup" 0 2 3 15
|
||||||
set_trap() {
|
|
||||||
trap "kill_childs" 0 2 3 15
|
tmp_files=$(mktemp -d)
|
||||||
}
|
awesome_log=$tmp_files/_awesome_test.log
|
||||||
set_trap
|
echo "awesome_log: $awesome_log"
|
||||||
|
|
||||||
# Wait for DISPLAY to be available, and setup xrdb,
|
# Wait for DISPLAY to be available, and setup xrdb,
|
||||||
# for awesome's xresources backend / queries.
|
# for awesome's xresources backend / queries.
|
||||||
|
|
Loading…
Reference in New Issue