summaryrefslogtreecommitdiff
path: root/test/run-in-tree.sh
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-10-12 00:18:02 +0200
committerAlexander Larsson <alexl@redhat.com>2012-10-12 00:21:26 +0200
commit8e999efb4f617d01b876f9b9d41cea11385cf3f9 (patch)
treef1f8d74acf763756ba75083198d657ed02dacb49 /test/run-in-tree.sh
parent7dfcc1d1fda1a9bd388ea0823e9b24807782b59e (diff)
downloadgvfs-8e999efb4f617d01b876f9b9d41cea11385cf3f9.tar.gz
Initial version of testing framework
This is an initial import of the gvfs-test test frameworks from Martin Pitt, integrated into the gvfs tree. For now its only run if you make test in the tests subdir as some tests are failing. It also doesn't use the gvfs-testbed script to launch a fuller test environment
Diffstat (limited to 'test/run-in-tree.sh')
-rwxr-xr-xtest/run-in-tree.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/run-in-tree.sh b/test/run-in-tree.sh
new file mode 100755
index 00000000..9cb638f2
--- /dev/null
+++ b/test/run-in-tree.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ $# -lt 1 ]; then
+ echo missing argument
+ exit
+fi
+
+# Set up env vars to make gvfs read mounts from the build tree
+export GVFS_MOUNTABLE_EXTENSION=".localmount"
+export GVFS_MOUNTABLE_DIR=`pwd`/../daemon
+export PATH=`pwd`/../programs:$PATH
+
+# Start a custom session dbus
+PIDFILE=`mktemp`
+export DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --config-file=session.conf --fork --print-address=1 --print-pid=3 3>${PIDFILE}`
+DBUS_SESSION_BUS_PID=`cat $PIDFILE`
+rm $PIDFILE
+
+trap "kill -9 $DBUS_SESSION_BUS_PID" SIGINT SIGTERM EXIT
+
+$@
+