X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/1a00f59083722d4d0e273339b1f4dc28a0fb2fa3..026a72d4f3e7d69c31c9523aa08554d159e21e1a:/scripts/format-gcov-report diff --git a/scripts/format-gcov-report b/scripts/format-gcov-report index f445329..0369ab6 100755 --- a/scripts/format-gcov-report +++ b/scripts/format-gcov-report @@ -33,17 +33,20 @@ def sgmlquotechar(c): def sgmlquote(s): return string.join(map(sgmlquotechar, s),'') +missing = {} percent = {} total_lines = 0 covered_lines = 0 args = sys.argv[1:] htmldir = None -while len(args) > 0: +while len(args) > 0 and re.match("^--", args[0]): if args[0] == "--html": htmldir = args[1] args = args[2:] else: fatal("unknown option '%s'" % args[0]) +for s in args: + missing[s] = True name = None for line in sys.stdin: @@ -51,6 +54,8 @@ for line in sys.stdin: r = re.match("File ['`](?:.*/)?([^/]+.c)'", line) if r: name = r.group(1) + if name in missing: + del missing[name] r = re.match("Lines executed:([0-9\\.]+)% of ([0-9]+)", line) if r: if name: @@ -84,6 +89,14 @@ if htmldir is not None and len(keys): (sgmlquote(k), sgmlquote(k), percent[k])) index.write("\n") index.write("

Total coverage: %d%%

\n" % (100 * (covered_lines / total_lines))) + missing_files = missing.keys() + missing_files.sort() + if len(missing_files) > 0: + index.write("

Missing files:

\n") + index.write("