diff --git a/HACKING b/HACKING
index 32a0e7020..2d755c538 100644
--- a/HACKING
+++ b/HACKING
@@ -186,6 +186,18 @@ compiler error), while most others (like randtgba, dve2check, randltl,
...) do fine.
+Log driver for testsuite
+------------------------
+
+The PASS/FAIL status for each test of the testsuite is printed by
+tools/test-driver. This script can be changed to format the output
+differently. When we use Teamcity (for continuous integration) we
+change the output format to something that Teamcity will understand
+with:
+
+ make check TEST_LOG_DRIVER=$PWD/tools/test-driver-teamcity
+
+
Coding conventions
==================
diff --git a/Makefile.am b/Makefile.am
index 8420f13b5..c73c7360e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,7 +38,8 @@ UTF8 = utf8/doc/ReleaseNotes utf8/doc/utf8cpp.html utf8/utf8.h \
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = HACKING ChangeLog.1 tools/gitlog-to-changelog tools/help2man \
- $(UTF8) m4/gnulib-cache.m4 .dir-locals.el
+ tools/test-driver-teamcity $(UTF8) m4/gnulib-cache.m4 \
+ .dir-locals.el
dist-hook: gen-ChangeLog
diff --git a/tools/test-driver-teamcity b/tools/test-driver-teamcity
new file mode 100755
index 000000000..1d322b5ed
--- /dev/null
+++ b/tools/test-driver-teamcity
@@ -0,0 +1,144 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2013-07-26.06; # UTC
+
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to or send patches to
+# .
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <$log_file 2>&1
+estatus=$?
+
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ estatus=1
+fi
+
+case $estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+case $res in
+ XPASS|FAIL|ERROR)
+ echo "##teamcity[testFailed name='$test_name' timestamp='`eval $ts`' message='$res' flowId='$$']";;
+ SKIP)
+ echo "##teamcity[testIgnored name='$test_name' timestamp='`eval $ts`' message='$res' flowId='$$']";;
+esac
+echo "##teamcity[testFinished name='$test_name' timestamp='`eval $ts`' flowId='$$']"
+echo "##teamcity[testSuiteFinished name='$test_name' flowId='$$']"
+
+
+# Report outcome to console.
+# echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/wrap/python/tests/Makefile.am b/wrap/python/tests/Makefile.am
index 47c61ca4a..fe7a52251 100644
--- a/wrap/python/tests/Makefile.am
+++ b/wrap/python/tests/Makefile.am
@@ -24,6 +24,7 @@ EXTRA_DIST = \
ltl2tgba.py
LOG_COMPILER = ./run
+LOG_DRIVER = $(TEST_LOG_DRIVER)
# ensure run is rebuilt before the tests are run.
check_SCRIPTS = run