Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50173 - trunk/tools/build/v2/test
From: ghost_at_[hidden]
Date: 2008-12-07 03:41:57


Author: vladimir_prus
Date: 2008-12-07 03:41:56 EST (Sun, 07 Dec 2008)
New Revision: 50173
URL: http://svn.boost.org/trac/boost/changeset/50173

Log:
Include annotations in test log
Text files modified:
   trunk/tools/build/v2/test/BoostBuild.py | 22 ++++++++++++++--------
   trunk/tools/build/v2/test/test_all.py | 12 ++++++++----
   2 files changed, 22 insertions(+), 12 deletions(-)

Modified: trunk/tools/build/v2/test/BoostBuild.py
==============================================================================
--- trunk/tools/build/v2/test/BoostBuild.py (original)
+++ trunk/tools/build/v2/test/BoostBuild.py 2008-12-07 03:41:56 EST (Sun, 07 Dec 2008)
@@ -22,22 +22,28 @@
 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 = []
 
 

Modified: trunk/tools/build/v2/test/test_all.py
==============================================================================
--- trunk/tools/build/v2/test/test_all.py (original)
+++ trunk/tools/build/v2/test/test_all.py 2008-12-07 03:41:56 EST (Sun, 07 Dec 2008)
@@ -64,17 +64,21 @@
                 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.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk