From: Daira Hopwood Date: Mon, 8 Sep 2014 21:49:23 +0000 (+0100) Subject: Update coverage-related targets in Makefile. refs #1698 X-Git-Tag: allmydata-tahoe-1.10.1a1~144 X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/module-simplejson.tests.html?a=commitdiff_plain;h=4f5104031309b1a71417f2f63acbb4a07ccecc26;p=tahoe-lafs%2Ftahoe-lafs.git Update coverage-related targets in Makefile. refs #1698 Signed-off-by: Daira Hopwood --- diff --git a/Makefile b/Makefile index cbb72d0f..24c7c602 100644 --- a/Makefile +++ b/Makefile @@ -51,10 +51,6 @@ test: check: test -test-coverage: build - rm -f .coverage - $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST) - quicktest: make-version $(TAHOE) debug trial $(TRIALARGS) $(TEST) @@ -70,19 +66,24 @@ _tmpfstest: make-version sudo umount '$(TMPDIR)' rmdir '$(TMPDIR)' -# code-coverage: install the "coverage" package from PyPI, do "make -# 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_tools/coverage.el for emacs integration. -quicktest-coverage: make-version - rm -f .coverage - PYTHONPATH=. $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST) -# on my laptop, "quicktest" takes 239s, "quicktest-coverage" takes 304s +# code coverage: install the "coverage" package from PyPI, do "make test-coverage" to +# do a unit test run with coverage-gathering enabled, then use "make coverage-output" to +# generate an HTML report. Also see "make .coverage.el" and misc/coding_tools/coverage.el +# for Emacs integration. + +# This might need to be python-coverage on Debian-based distros. +COVERAGE=coverage + +COVERAGEARGS=--branch --source=src/allmydata # --include appeared in coverage-3.4 COVERAGE_OMIT=--include '$(CURDIR)/src/allmydata/*' --omit '$(CURDIR)/src/allmydata/test/*' + +test-coverage: build + rm -f .coverage + $(TAHOE) '@$(COVERAGE)' run $(COVERAGEARGS) @tahoe debug trial $(TRIALARGS) $(TEST) + coverage-output: rm -rf coverage-html coverage html -i -d coverage-html $(COVERAGE_OMIT) diff --git a/misc/coding_tools/coverage2el.py b/misc/coding_tools/coverage2el.py index f2b7ee4b..a3d8d545 100644 --- a/misc/coding_tools/coverage2el.py +++ b/misc/coding_tools/coverage2el.py @@ -18,7 +18,7 @@ class ElispReporter(summary.SummaryReporter): out = open(".coverage.el", "w") out.write(""" -;; This is an elisp-readable form of the figleaf coverage data. It defines a +;; This is an elisp-readable form of the coverage data. It defines a ;; single top-level hash table in which the key is an asolute pathname, and ;; the value is a three-element list. The first element of this list is a ;; list of line numbers that represent actual code statements. The second is