coverage tools: ignore errors, display lines-uncovered in elisp mode. Fix Makefile paths.

This commit is contained in:
Brian Warner 2010-08-04 00:11:31 -07:00
parent 8cd44b1baa
commit 818089644a
3 changed files with 10 additions and 6 deletions

View File

@ -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

View 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"))

View 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))