diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-03 12:25:31 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-05 12:35:11 +0100 |
commit | 9d80d46a794e0770494aa517d1b94e7e6ea9e21d (patch) | |
tree | ca9647210c53825397d73407d23bb99756b4e7cc /tools | |
parent | 30e7a81302a60adc4ec497deee3c0dfe8ec1123e (diff) | |
download | dbus-9d80d46a794e0770494aa517d1b94e7e6ea9e21d.tar.gz |
run-with-tmp-session-bus.sh: create a unique temporary file per process
This makes the regression tests OK to run in parallel.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68852
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/run-with-tmp-session-bus.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/run-with-tmp-session-bus.sh b/tools/run-with-tmp-session-bus.sh index 3245652e..94ae8fc8 100755 --- a/tools/run-with-tmp-session-bus.sh +++ b/tools/run-with-tmp-session-bus.sh @@ -4,9 +4,12 @@ SCRIPTNAME="$0" WRAPPED_SCRIPT="$1" shift +CONFIG_FILE=./tmp-session-bus.$$.conf + die () { echo "$SCRIPTNAME: $*" >&2 + rm -f "$CONFIG_FILE" exit 1 } @@ -14,7 +17,6 @@ if test -z "$DBUS_TOP_BUILDDIR" ; then die "Must set DBUS_TOP_BUILDDIR" fi -CONFIG_FILE=./run-with-tmp-session-bus.conf SERVICE_DIR="$DBUS_TOP_BUILDDIR/test/data/valid-service-files" ESCAPED_SERVICE_DIR=`echo $SERVICE_DIR | sed -e 's/\//\\\\\\//g'` echo "escaped service dir is: $ESCAPED_SERVICE_DIR" >&2 @@ -48,8 +50,13 @@ unset DBUS_SESSION_BUS_PID DBUS_USE_TEST_BINARY=1 export DBUS_USE_TEST_BINARY -exec $DBUS_TOP_BUILDDIR/tools/dbus-run-session \ +$DBUS_TOP_BUILDDIR/tools/dbus-run-session \ --config-file="$CONFIG_FILE" \ --dbus-daemon="$DBUS_TOP_BUILDDIR/bus/dbus-daemon" \ -- \ "$WRAPPED_SCRIPT" "$@" +error=$? + +# clean up +rm -f "$CONFIG_FILE" +exit $error |