test/coverage: fix indention

This commit is contained in:
Matthias Ringwald 2020-08-28 17:19:18 +02:00
parent 63f2efc94d
commit d48fc4b93a

View File

@ -26,9 +26,9 @@ def list_category_table():
categories = [ 'Line', 'Function', 'Branch']; categories = [ 'Line', 'Function', 'Branch'];
for category in categories: for category in categories:
hit = summary[category + "_hit"] hit = summary[category + "_hit"]
total = summary[category + "_total"] total = summary[category + "_total"]
coverage = 100.0 * hit / total coverage = 100.0 * hit / total
print ( row % ( category, hit, total, "%.1f" % coverage)) print ( row % ( category, hit, total, "%.1f" % coverage))
filter = sys.argv[1:] filter = sys.argv[1:]
@ -38,29 +38,29 @@ print("\nParsing HTML Coverage Report")
tree = html.parse(coverage_html_path) tree = html.parse(coverage_html_path)
files = tree.xpath("//td[@class='coverFile']") files = tree.xpath("//td[@class='coverFile']")
for file in files: for file in files:
row = file.getparent() row = file.getparent()
children = row.getchildren() children = row.getchildren()
path = children[0].text_content() path = children[0].text_content()
lineCov = children[3].text_content() lineCov = children[3].text_content()
functionCov = children[5].text_content() functionCov = children[5].text_content()
branchCov = children[7].text_content() branchCov = children[7].text_content()
(lineHit, lineTotal) = [int(x) for x in lineCov.split("/")] (lineHit, lineTotal) = [int(x) for x in lineCov.split("/")]
(functionHit, functionTotal) = [int(x) for x in functionCov.split("/")] (functionHit, functionTotal) = [int(x) for x in functionCov.split("/")]
(branchHit, branchTotal) = [int(x) for x in branchCov.split("/")] (branchHit, branchTotal) = [int(x) for x in branchCov.split("/")]
# print(path, lineHit, lineTotal, functionHit, functionTotal, branchHit, branchTotal) # print(path, lineHit, lineTotal, functionHit, functionTotal, branchHit, branchTotal)
# filter # filter
if path in filter: if path in filter:
print("- Skipping " + path) print("- Skipping " + path)
continue continue
print("- Adding " + path) print("- Adding " + path)
update_category('Line_hit', lineHit) update_category('Line_hit', lineHit)
update_category('Line_total', lineTotal) update_category('Line_total', lineTotal)
update_category('Function_hit', functionHit) update_category('Function_hit', functionHit)
update_category('Function_total', functionTotal) update_category('Function_total', functionTotal)
update_category('Branch_hit', branchHit) update_category('Branch_hit', branchHit)
update_category('Branch_total', branchTotal) update_category('Branch_total', branchTotal)
print("") print("")
list_category_table() list_category_table()