diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-18 19:04:40 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-09-19 14:26:02 +0100 |
commit | af998be5e6638671d05097176c7405258b30e315 (patch) | |
tree | c163ada435b84436bf6e5349d9c84af35d596cb6 | |
parent | cfb5810baf0b6f28223d2ebf7b9c20eddf2940cf (diff) | |
download | telepathy-mission-control-af998be5e6638671d05097176c7405258b30e315.tar.gz |
tests: cd into the directory from which we were run
dbus-daemon does a chdir("/") for activated services. We want to
undo that, and put our logs (and core dumps, if any) in a more
obvious place.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r-- | tests/twisted/run-test.sh.in | 5 | ||||
-rw-r--r-- | tests/twisted/tools/exec-with-log.sh.in | 7 | ||||
-rwxr-xr-x | tests/twisted/tools/run-mc.sh.in | 6 |
3 files changed, 17 insertions, 1 deletions
diff --git a/tests/twisted/run-test.sh.in b/tests/twisted/run-test.sh.in index f2717356..2cb87b3d 100644 --- a/tests/twisted/run-test.sh.in +++ b/tests/twisted/run-test.sh.in @@ -13,6 +13,9 @@ set -e +MC_TEST_CURDIR="`pwd`" +export MC_TEST_CURDIR + if test "x$MC_TEST_UNINSTALLED" = x; then script_fullname=`readlink -e "@mctestsdir@/twisted/run-test.sh"` if [ `readlink -e "$0"` != "$script_fullname" ] ; then @@ -83,7 +86,7 @@ any_failed=0 for i in $list ; do echo "Testing $i ..." - tmp="`pwd`/tmp-`echo $i | tr ./ __`" + tmp="${MC_TEST_CURDIR}/tmp-`echo $i | tr ./ __`" rm -fr "$tmp" mkdir "$tmp" diff --git a/tests/twisted/tools/exec-with-log.sh.in b/tests/twisted/tools/exec-with-log.sh.in index 364b9888..61380460 100644 --- a/tests/twisted/tools/exec-with-log.sh.in +++ b/tests/twisted/tools/exec-with-log.sh.in @@ -22,6 +22,13 @@ G_MESSAGES_DEBUG=all export G_MESSAGES_DEBUG ulimit -c unlimited +if test -z "$MC_TEST_CURDIR"; then + echo "MC_TEST_CURDIR must be set" + exit 1 +fi + +cd "${MC_TEST_CURDIR}" || exit 1 + if test -z "$MC_TEST_LOG_DIR"; then echo "MC_TEST_LOG_DIR must be set" exit 1 diff --git a/tests/twisted/tools/run-mc.sh.in b/tests/twisted/tools/run-mc.sh.in index 9e321403..4c7528f3 100755 --- a/tests/twisted/tools/run-mc.sh.in +++ b/tests/twisted/tools/run-mc.sh.in @@ -10,6 +10,12 @@ if test -z "$MC_TEST_LOG_DIR"; then exit 1 fi +if test -z "$MC_TEST_CURDIR"; then + echo "MC_TEST_CURDIR must be set" + exit 1 +fi +cd "${MC_TEST_CURDIR}" || exit 1 + exec > ${MC_TEST_LOG_DIR}/missioncontrol-$$.log 2>&1 ln -f ${MC_TEST_LOG_DIR}/missioncontrol-$$.log missioncontrol.log |