File: 1002_tests-prepare-a-temporary-directory-for-the-database.patch

package info (click to toggle)
qtcontacts-sqlite 0.3.20-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,952 kB
  • sloc: cpp: 32,880; ansic: 1,269; xml: 62; makefile: 32; sh: 18
file content (20 lines) | stat: -rw-r--r-- 664 bytes parent folder | download | duplicates (2)
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