Index: third_party/coverage-3.7.1/coverage/xmlreport.py |
diff --git a/third_party/coverage-3.6/coverage/xmlreport.py b/third_party/coverage-3.7.1/coverage/xmlreport.py |
similarity index 96% |
rename from third_party/coverage-3.6/coverage/xmlreport.py |
rename to third_party/coverage-3.7.1/coverage/xmlreport.py |
index 301bc8654653bd37107ec36c3e5f178a6798ca5c..26ac02ad13d06077a9e46da349c0b88ec13d919b 100644 |
--- a/third_party/coverage-3.6/coverage/xmlreport.py |
+++ b/third_party/coverage-3.7.1/coverage/xmlreport.py |
@@ -85,7 +85,12 @@ class XmlReporter(Reporter): |
outfile.write(self.xml_out.toprettyxml()) |
# Return the total percentage. |
- return 100.0 * (lhits_tot + bhits_tot) / (lnum_tot + bnum_tot) |
+ denom = lnum_tot + bnum_tot |
+ if denom == 0: |
+ pct = 0.0 |
+ else: |
+ pct = 100.0 * (lhits_tot + bhits_tot) / denom |
+ return pct |
def xml_file(self, cu, analysis): |
"""Add to the XML report for a single file.""" |
@@ -112,7 +117,7 @@ class XmlReporter(Reporter): |
branch_stats = analysis.branch_stats() |
# For each statement, create an XML 'line' element. |
- for line in analysis.statements: |
+ for line in sorted(analysis.statements): |
xline = self.xml_out.createElement("line") |
xline.setAttribute("number", str(line)) |