From d48fc4b93a964f7c8f57d18e879a81a2fbfb5dc2 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 28 Aug 2020 17:19:18 +0200 Subject: [PATCH] test/coverage: fix indention --- test/coverage_filter.py | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/coverage_filter.py b/test/coverage_filter.py index 0d680a273..49a566ef0 100755 --- a/test/coverage_filter.py +++ b/test/coverage_filter.py @@ -26,9 +26,9 @@ def list_category_table(): categories = [ 'Line', 'Function', 'Branch']; for category in categories: - hit = summary[category + "_hit"] - total = summary[category + "_total"] - coverage = 100.0 * hit / total + hit = summary[category + "_hit"] + total = summary[category + "_total"] + coverage = 100.0 * hit / total print ( row % ( category, hit, total, "%.1f" % coverage)) filter = sys.argv[1:] @@ -38,29 +38,29 @@ print("\nParsing HTML Coverage Report") tree = html.parse(coverage_html_path) files = tree.xpath("//td[@class='coverFile']") for file in files: - row = file.getparent() - children = row.getchildren() - path = children[0].text_content() - lineCov = children[3].text_content() - functionCov = children[5].text_content() - branchCov = children[7].text_content() - (lineHit, lineTotal) = [int(x) for x in lineCov.split("/")] - (functionHit, functionTotal) = [int(x) for x in functionCov.split("/")] - (branchHit, branchTotal) = [int(x) for x in branchCov.split("/")] - # print(path, lineHit, lineTotal, functionHit, functionTotal, branchHit, branchTotal) + row = file.getparent() + children = row.getchildren() + path = children[0].text_content() + lineCov = children[3].text_content() + functionCov = children[5].text_content() + branchCov = children[7].text_content() + (lineHit, lineTotal) = [int(x) for x in lineCov.split("/")] + (functionHit, functionTotal) = [int(x) for x in functionCov.split("/")] + (branchHit, branchTotal) = [int(x) for x in branchCov.split("/")] + # print(path, lineHit, lineTotal, functionHit, functionTotal, branchHit, branchTotal) - # filter - if path in filter: - print("- Skipping " + path) - continue + # filter + if path in filter: + print("- Skipping " + path) + continue - print("- Adding " + path) - update_category('Line_hit', lineHit) - update_category('Line_total', lineTotal) - update_category('Function_hit', functionHit) - update_category('Function_total', functionTotal) - update_category('Branch_hit', branchHit) - update_category('Branch_total', branchTotal) + print("- Adding " + path) + update_category('Line_hit', lineHit) + update_category('Line_total', lineTotal) + update_category('Function_hit', functionHit) + update_category('Function_total', functionTotal) + update_category('Branch_hit', branchHit) + update_category('Branch_total', branchTotal) print("") list_category_table()