telepathy-mission-control: tests: write logs to MC_TEST_LOG_DIR, with latest log in `pwd`

Simon McVittie smcv at kemper.freedesktop.org
Thu Sep 19 11:42:53 PDT 2013


Module: telepathy-mission-control
Branch: master
Commit: 545ffc1f455a14bea9f77497a009ec6811bae6c7
URL:    http://cgit.freedesktop.org/telepathy/telepathy-mission-control/commit/?id=545ffc1f455a14bea9f77497a009ec6811bae6c7

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed Sep 18 16:00:49 2013 +0100

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 at collabora.co.uk>

---

 tests/twisted/Makefile.am               |    8 ++++----
 tests/twisted/README                    |    4 ++--
 tests/twisted/run-test.sh.in            |    2 ++
 tests/twisted/tools/exec-with-log.sh.in |   11 +++++------
 tests/twisted/tools/run-mc.sh.in        |   10 ++++++++++
 5 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am
index 7f8710f..71149d1 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 6fdc7ce..ced06a2 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 170b73b..f271735 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 7c2bfd5..364b988 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 922eeb5..9e32140 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



More information about the telepathy-commits mailing list