[glib] gtester-report: Add an optional 'revision' node



commit 52c831099e5fed55482c3d8cf43b457e37843bd6
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Oct 12 16:03:56 2010 +0100

    gtester-report: Add an optional 'revision' node
    
    In order to distinguish reports generated from a specific revision of a
    projects it would be good if gtester-report handled a <revision> node in
    the XML.
    
    The payload is free-form, just like for the other nodes under <info>.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=631980

 glib/gtester-report |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/glib/gtester-report b/glib/gtester-report
index 3bce548..0fcdd9a 100755
--- a/glib/gtester-report
+++ b/glib/gtester-report
@@ -135,6 +135,9 @@ class ReportReader (TreeProcess):
     self.info['package'] = node_as_text (dn)
     dn = find_child (node, 'version')
     self.info['version'] = node_as_text (dn)
+    dn = find_child (node, 'revision')
+    if dn is not None:
+        self.info['revision'] = node_as_text (dn)
   def handle_testcase (self, node):
     self.last_binary.testcases += [ node ]
     result = attribute_as_text (node, 'result', 'status')
@@ -239,6 +242,8 @@ class HTMLReportWriter(ReportWriter):
       self.lastchar = message[-1]
   def handle_info (self):
     self.oprint ('<h3>Package: %(package)s, version: %(version)s</h3>\n' % self.info)
+    if self.info['revision']:
+        self.oprint ('<h5>Report generated from: %(revision)s</h5>\n' % self.info)
   def handle_text (self, node):
     self.oprint (node.nodeValue)
   def handle_testcase (self, node, binary):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]