]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
coverage tools: ignore errors, display lines-uncovered in elisp mode. Fix Makefile...
authorBrian Warner <warner@lothar.com>
Wed, 4 Aug 2010 07:11:31 +0000 (00:11 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 4 Aug 2010 07:11:31 +0000 (00:11 -0700)
Makefile
misc/coding_tools/coverage.el
misc/coding_tools/coverage2el.py

index 42753b0bbf5d076d38ad7fb7d3a363b1202e5da8..723d656d0e2bcfb9260eadbe3f66b685220a1d2d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -125,7 +125,7 @@ quicktest:
 # quicktest-coverage" to do a unit test run with coverage-gathering enabled,
 # then use "make coverate-output-text" for a brief report, or "make
 # coverage-output" for a pretty HTML report. Also see "make .coverage.el" and
-# misc/coding_helpers/coverage.el for emacs integration.
+# misc/coding_tools/coverage.el for emacs integration.
 
 quicktest-coverage:
        rm -f .coverage
@@ -134,7 +134,7 @@ quicktest-coverage:
 
 coverage-output:
        rm -rf coverage-html
-       coverage html -d coverage-html
+       coverage html -i -d coverage-html $(COVERAGE_OMIT)
        cp .coverage coverage-html/coverage.data
        @echo "now point your browser at coverage-html/index.html"
 
@@ -154,7 +154,7 @@ coverage-output:
 .PHONY: repl test-darcs-boringfile test-clean clean find-trailing-spaces
 
 .coverage.el: .coverage
-       $(PYTHON) misc/coding_helpers/coverage2el.py
+       $(PYTHON) misc/coding_tools/coverage2el.py
 
 # 'upload-coverage' is meant to be run with an UPLOAD_TARGET=host:/dir setting
 ifdef UPLOAD_TARGET
index bad490fd66e069b17f31441b32b0cf09629430b7..8d69d5d78679bea76dd2b116641592b2309050ef 100644 (file)
@@ -84,7 +84,8 @@
                            'face '(:box "red")
                            )
               )
-            (message "Added annotations")
+            (message (format "Added annotations: %d uncovered lines"
+                             (safe-length uncovered-code-lines)))
             )
           )
       (message "unable to find coverage for this file"))
index ed94bd0ffbc6510037d719f176086a3f7406d14c..7d03a273c52833c9cb2bbca70866d807305bb166 100644 (file)
@@ -1,5 +1,5 @@
 
-from coverage import coverage, summary
+from coverage import coverage, summary, misc
 
 class ElispReporter(summary.SummaryReporter):
     def report(self):
@@ -21,7 +21,10 @@ class ElispReporter(summary.SummaryReporter):
         out.write("(let ((results (make-hash-table :test 'equal)))\n")
         for cu in self.code_units:
             f = cu.filename
-            (fn, executable, missing, mf) = self.coverage.analysis(cu)
+            try:
+                (fn, executable, missing, mf) = self.coverage.analysis(cu)
+            except misc.NoSource:
+                continue
             code_linenumbers = executable
             uncovered_code = missing
             covered_linenumbers = sorted(set(executable) - set(missing))