summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-18 16:00:49 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-09-19 14:25:59 +0100
commit545ffc1f455a14bea9f77497a009ec6811bae6c7 (patch)
tree8985159606ae4f8d7083b1aaed377071abf4f4e7
parent30dc2928196aefd112db7047a98900c047f27bae (diff)
downloadtelepathy-mission-control-545ffc1f455a14bea9f77497a009ec6811bae6c7.tar.gz
tests: write logs to MC_TEST_LOG_DIR, with latest log in `pwd`
This makes the logs' location rather more obvious. Not altering MC's working directory also means the core dump (if any) comes out in tests/twisted, which makes sense, instead of tests/twisted/tools, which doesn't. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69542 Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--tests/twisted/Makefile.am8
-rw-r--r--tests/twisted/README4
-rw-r--r--tests/twisted/run-test.sh.in2
-rw-r--r--tests/twisted/tools/exec-with-log.sh.in11
-rwxr-xr-xtests/twisted/tools/run-mc.sh.in10
5 files changed, 23 insertions, 12 deletions
diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 7f8710fd..71149d18 100644
--- a/tests/twisted/Makefile.am
+++ b/tests/twisted/Makefile.am
@@ -251,8 +251,7 @@ CHECK_TWISTED_SLOW =
check-twisted: $(BUILT_SOURCES)
$(MAKE) -C tools
- rm -f tools/core
- rm -f tools/missioncontrol-*.log
+ rm -f core
failed=0; \
if test x$(CHECK_TWISTED_SLOW) = x; then \
extra_tests= ; \
@@ -263,8 +262,8 @@ check-twisted: $(BUILT_SOURCES)
MC_ABS_TOP_SRCDIR=@abs_top_srcdir@ \
MC_ABS_TOP_BUILDDIR=@abs_top_builddir@ \
sh run-test.sh "${TWISTED_TESTS}${extra_tests}"
- if test -e tools/core; then\
- echo "Core dump exists: tools/core";\
+ if test -e core; then\
+ echo "Core dump exists: core";\
exit 1;\
fi
@@ -282,6 +281,7 @@ CLEANFILES = \
accounts/accounts.cfg \
accounts/.mc_connections \
mc-[1-9]*.log \
+ missioncontrol.log \
*.pyc \
*/*.pyc \
with-session-bus-*.dbus-monitor-logs \
diff --git a/tests/twisted/README b/tests/twisted/README
index 6fdc7ce3..ced06a2a 100644
--- a/tests/twisted/README
+++ b/tests/twisted/README
@@ -16,10 +16,10 @@ To run with debug information:
To debug an individual test you can set one of the following env variable:
* MISSIONCONTROL_TEST_VALGRIND : to run Mission Control inside valgrind. The
- report is added to tools/missioncontrol-testing.log.
+ report is added to missioncontrol.log.
* MISSIONCONTROL_TEST_REFDBG : to run Mission Control inside refdbg. The
- report is written to tools/refdbg.log. You can change
+ report is written to refdbg.log. You can change
MISSIONCONTROL_WRAPPER to use an alternative refdbg and change
REFDBG_OPTIONS to set your own parameters. Example:
export MISSIONCONTROL_TEST_REFDBG=1
diff --git a/tests/twisted/run-test.sh.in b/tests/twisted/run-test.sh.in
index 170b73b1..f2717356 100644
--- a/tests/twisted/run-test.sh.in
+++ b/tests/twisted/run-test.sh.in
@@ -87,6 +87,8 @@ for i in $list ; do
rm -fr "$tmp"
mkdir "$tmp"
+ MC_TEST_LOG_DIR="${tmp}"
+ export MC_TEST_LOG_DIR
MC_ACCOUNT_DIR="${tmp}/mc-account-dir"
export MC_ACCOUNT_DIR
XDG_CONFIG_HOME="${tmp}/config"
diff --git a/tests/twisted/tools/exec-with-log.sh.in b/tests/twisted/tools/exec-with-log.sh.in
index 7c2bfd5a..364b9888 100644
--- a/tests/twisted/tools/exec-with-log.sh.in
+++ b/tests/twisted/tools/exec-with-log.sh.in
@@ -18,19 +18,18 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
-cd "@abs_top_builddir@/tests/twisted/tools"
-
G_MESSAGES_DEBUG=all
export G_MESSAGES_DEBUG
ulimit -c unlimited
-exec > missioncontrol-$$.log 2>&1
-ln -f missioncontrol-$$.log missioncontrol.log
-if test -z "$MC_ACCOUNT_DIR"; then
- echo "MC_ACCOUNT_DIR must be set"
+if test -z "$MC_TEST_LOG_DIR"; then
+ echo "MC_TEST_LOG_DIR must be set"
exit 1
fi
+exec > ${MC_TEST_LOG_DIR}/missioncontrol-$$.log 2>&1
+ln -f ${MC_TEST_LOG_DIR}/missioncontrol-$$.log missioncontrol.log
+
if test -n "$MISSIONCONTROL_TEST_VALGRIND"; then
G_DEBUG="$G_DEBUG,gc-friendly"
export G_DEBUG
diff --git a/tests/twisted/tools/run-mc.sh.in b/tests/twisted/tools/run-mc.sh.in
index 922eeb5b..9e321403 100755
--- a/tests/twisted/tools/run-mc.sh.in
+++ b/tests/twisted/tools/run-mc.sh.in
@@ -1,7 +1,17 @@
#!/bin/sh
+G_MESSAGES_DEBUG=all
+export G_MESSAGES_DEBUG
+
ulimit -c unlimited
+if test -z "$MC_TEST_LOG_DIR"; then
+ echo "MC_TEST_LOG_DIR must be set"
+ exit 1
+fi
+
+exec > ${MC_TEST_LOG_DIR}/missioncontrol-$$.log 2>&1
+ln -f ${MC_TEST_LOG_DIR}/missioncontrol-$$.log missioncontrol.log
# Our fake session bus is also a fake system bus, but it doesn't know that
# when it service-activates us