1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Author: Alberto Mardegan <mardy@users.sourceforge.net>
Description: tests: prepare a temporary directory for the database
diff --git a/tests/run_test.sh b/tests/run_test.sh
--- a/tests/run_test.sh
+++ b/tests/run_test.sh
@@ -22,9 +22,13 @@ OUTPUT=$(dbus-daemon --session --print-address '' --print-pid '' --fork)
export DBUS_SESSION_BUS_ADDRESS=$(echo "$OUTPUT" | head -1)
DBUS_DAEMON_PID=$(echo "$OUTPUT" | tail -1)
+# Setup a temporary directory for the database file
+export XDG_DATA_HOME="$(mktemp -d)"
+
cleanUp() {
echo "Killing the temporary D-Bus daemon"
kill "$DBUS_DAEMON_PID"
+ rm -r "$XDG_DATA_HOME"
}
trap cleanUp EXIT INT TERM
|