diff --git a/v2/test/BoostBuild.py b/v2/test/BoostBuild.py
index 05ebe53e5..f2612c28f 100644
--- a/v2/test/BoostBuild.py
+++ b/v2/test/BoostBuild.py
@@ -22,22 +22,28 @@ import traceback
import tree
import types
+from xml.sax.saxutils import escape
+
annotations = []
-def print_annotation(name, value):
+def print_annotation(name, value, xml):
"""Writes some named bits of information about test run.
"""
- print name + " {{{"
- print value
- print "}}}"
-
-
-def flush_annotations():
+ if xml:
+ print escape(name) + " {{{"
+ print escape(value)
+ print "}}}"
+ else:
+ print name + " {{{"
+ print value
+ print "}}}"
+
+def flush_annotations(xml=0):
global annotations
for ann in annotations:
- print_annotation(ann[0], ann[1])
+ print_annotation(ann[0], ann[1], xml)
annotations = []
diff --git a/v2/test/test_all.py b/v2/test/test_all.py
index ed1b3d738..04a675d03 100644
--- a/v2/test/test_all.py
+++ b/v2/test/test_all.py
@@ -64,17 +64,21 @@ def run_tests(critical_tests, other_tests):
print "PASSED"
else:
print "FAILED"
- BoostBuild.flush_annotations();
else:
rs = "succeed"
if not passed:
rs = "fail"
print """
-
-
-""" % (i, toolset, rs)
+""" % (i, toolset, rs)
+ if not passed:
+ BoostBuild.flush_annotations(1)
+
+ print """
+
+
+"""
pass_count = pass_count + 1
sys.stdout.flush() # Makes testing under emacs more entertaining.