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
This commit is contained in:
Emmanuele Bassi 2010-10-12 16:03:56 +01:00
parent 408a9fcbcc
commit 52c831099e

View File

@ -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):