Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1250)

Unified Diff: third_party/coverage-3.7.1/coverage/xmlreport.py

Issue 225633007: Upgrade to coverage 3.7.1 and have it auto-build itself on first use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: sigh our imports are a mess Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/coverage-3.7.1/coverage/version.py ('k') | third_party/coverage-3.7.1/doc/api.rst » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « third_party/coverage-3.7.1/coverage/version.py ('k') | third_party/coverage-3.7.1/doc/api.rst » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698