# 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
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"
.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
'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"))
-from coverage import coverage, summary
+from coverage import coverage, summary, misc
class ElispReporter(summary.SummaryReporter):
def report(self):
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))