2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Include annotations in test log

[SVN r50173]
This commit is contained in:
Vladimir Prus
2008-12-07 08:41:56 +00:00
parent 0ae6ebeb9d
commit 7cb2facd25
2 changed files with 22 additions and 12 deletions

View File

@@ -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 = []

View File

@@ -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 """
<test-log library="build" test-name="%s" test-type="run" toolset="%s">
<run result="%s"/>
</test-log>
""" % (i, toolset, rs)
<run result="%s">""" % (i, toolset, rs)
if not passed:
BoostBuild.flush_annotations(1)
print """
</run>
</test-log>
"""
pass_count = pass_count + 1
sys.stdout.flush() # Makes testing under emacs more entertaining.