diff options
author | Kevin Rocard <kevinx.rocard@intel.com> | 2013-06-20 10:28:54 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:04:02 +0100 |
commit | 02726ec37a9686572f825520a04700061ffe5d06 (patch) | |
tree | 2a7d81e79a09e77c3b233ea1a182d88d2f794503 /tools | |
parent | cf031996ede8428065b6d7648e34720a1874f5fa (diff) | |
download | external_parameter-framework-02726ec37a9686572f825520a04700061ffe5d06.zip external_parameter-framework-02726ec37a9686572f825520a04700061ffe5d06.tar.gz external_parameter-framework-02726ec37a9686572f825520a04700061ffe5d06.tar.bz2 |
[coverage] Create a root element with coverage attributes
BZ: 115218
The exported xml coverage report root element did not contain any
attributes thus the total coverage was not outputted.
Use the base export to xml - modified to use an existing node - to
export the root element.
Change-Id: I706a45159ae0af5a1b353f7776f62dab3c64f3f5
Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Reviewed-on: http://android.intel.com:8080/114695
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com>
Reviewed-by: cactus <cactus@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/coverage.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/coverage.py b/tools/coverage.py index 8aa941f..df79b5b 100755 --- a/tools/coverage.py +++ b/tools/coverage.py @@ -195,8 +195,10 @@ class Element(): str(dumpedDescription) for dumpedDescription in self._dumpDescription(withCoverage, withNbUse)) - def exportToXML(self): - domElement = xml.dom.minidom.Element(self.tag) + def exportToXML(self, domElement=None): + if domElement == None: + domElement = xml.dom.minidom.Element(self.tag) + self._XMLaddAttributes(domElement) for child in self.children : @@ -852,7 +854,7 @@ class ParsePFWlog(): class Root(Element): - tag = "Root" + tag = "CoverageReport" def __init__(self, name, dom): super().__init__(name) # Create domain tree @@ -866,11 +868,8 @@ class Root(Element): def exportToXML(self): """Export tree to an xml document""" impl = xml.dom.minidom.getDOMImplementation() - newdoc = impl.createDocument(None, self.name, None) - XMLDocElement = newdoc.documentElement - - for child in self.children: - XMLDocElement.appendChild(child.exportToXML()) + newdoc = impl.createDocument(namespaceURI=None, qualifiedName=self.tag, doctype=None) + super().exportToXML(newdoc.documentElement) return newdoc @@ -1022,7 +1021,7 @@ def main(): dom = xml.dom.minidom.parse(commandLineArguments.domainsFile) # Create element tree - root = Root("Coverage", dom) + root = Root("DomainCoverage", dom) # Parse PFW events parser = ParsePFWlog(root.domains, root.criteria, commandLineArguments.errorToIgnore) |