Commit 358e7d8c authored by Jeremy Whiting's avatar Jeremy Whiting
Browse files

tests: Add execute-test.sh to do test output capturing.

tests: Call execute-test.sh from each of with-session-bus scripts.
parent ebb44f51
#!/bin/sh
# with-session-bus.sh - run a program with a temporary D-Bus session daemon
#
# interesting bits have been move into dbus to permit reusability
#
# Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
e=0
if test -t 1 && test "z$CHECK_VERBOSE" != z; then
"$@" || e=$?
else
"$@" > capture-$$.log 2>&1 || e=$?
fi
# if exit code is 0, check for skipped tests
if test z$e = z0; then
grep -i skipped capture-$$.log || true
rm -f capture-$$.log
# exit code is not 0, so output log and exit
else
cat capture-$$.log
exit $e
fi
......@@ -37,7 +37,8 @@ dbus_start
eds_start
e=0
"$@" || e=$?
$cur_dir"/execute-test.sh" "$@" || e=$?
trap - INT HUP TERM
cleanup
......
......@@ -37,7 +37,7 @@ dbus_start
tracker_start
e=0
"$@" || e=$?
$cur_dir"/execute-test.sh" "$@" || e=$?
trap - INT HUP TERM
cleanup
......
......@@ -31,23 +31,9 @@ trap cleanup INT HUP TERM
dbus_init 0
dbus_start
e=0
if test -t 1 && test "z$CHECK_VERBOSE" != z; then
"$@" || e=$?
else
"$@" > capture-$$.log 2>&1 || e=$?
fi
$cur_dir"/execute-test.sh" "$@" || e=$?
trap - INT HUP TERM
cleanup
# if exit code is 0, check for skipped tests
if test z$e = z0; then
grep -i skipped capture-$$.log || true
rm -f capture-$$.log
# exit code is not 0, so output log and exit
else
cat capture-$$.log
exit $e
fi
exit $e
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment