From 3d853cec0b8148a64a2adbee19cf7a38270aa075 Mon Sep 17 00:00:00 2001 Message-Id: <3d853cec0b8148a64a2adbee19cf7a38270aa075.1714727632.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 1 Dec 2007 16:15:55 +0000 Subject: [PATCH] list uncovered files in lib/ Organization: Straylight/Edgeware From: Richard Kettlewell --- .bzrignore | 1 + lib/Makefile.am | 2 +- scripts/format-gcov-report | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.bzrignore b/.bzrignore index 3ccc643..caa175b 100644 --- a/.bzrignore +++ b/.bzrignore @@ -138,3 +138,4 @@ clients/index.html disobedience/index.html lib/index.html server/index.html +.DS_Store diff --git a/lib/Makefile.am b/lib/Makefile.am index 21f3874..3488588 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -99,7 +99,7 @@ check-report: before-check check make-coverage-reports before-check: rm -f *.gcda *.gcov make-coverage-reports: - ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . + ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . *.c rebuild-unicode: cd ${srcdir} && ${top_srcdir}/scripts/make-unidata 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("