chiark / gitweb /
list uncovered files in lib/
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 1 Dec 2007 16:15:55 +0000 (16:15 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 1 Dec 2007 16:15:55 +0000 (16:15 +0000)
.bzrignore
lib/Makefile.am
scripts/format-gcov-report

index 3ccc643e8117a6dddf9348d1258d43e2eead40e6..caa175b4bd9c3f3c3080443b7b8ef97d09e07785 100644 (file)
@@ -138,3 +138,4 @@ clients/index.html
 disobedience/index.html
 lib/index.html
 server/index.html
+.DS_Store
index 21f3874e113f58ae1bae1ee1fae9d6ad90ae08fb..348858866519b0e2e078dcb6de45f7a50708e676 100644 (file)
@@ -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
index f445329cffb9caa28b158a9fca00909ba7f2d5e0..0369ab63d3be84f624fcd9c291f957940f41a8e5 100755 (executable)
@@ -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("</table>\n")
   index.write("<p>Total coverage: %d%%</p>\n" % (100 * (covered_lines / total_lines)))
+  missing_files = missing.keys()
+  missing_files.sort()
+  if len(missing_files) > 0:
+    index.write("<p>Missing files:</p>\n")
+    index.write("<ul>\n")
+    for mf in missing_files:
+      index.write("<li><a href=\"%s\">%s</a></li>\n" % (mf, mf))
+    index.write("</lu>\n")
   for k in keys:
     html = open(os.path.join(htmldir, "%s.html" % k), "w")
     html.write("<html><head><title>%s</title>\n" % sgmlquote(k))