Browse Source

Add coverage config.

Jelmer Vernooij 8 years ago
parent
commit
2341eafa35
3 changed files with 15 additions and 0 deletions
  1. 6 0
      .coveragerc
  2. 2 0
      .gitignore
  3. 7 0
      Makefile

+ 6 - 0
.coveragerc

@@ -0,0 +1,6 @@
+[run]
+branch = True
+
+[report]
+exclude_lines =
+    raise NotImplementedError

+ 2 - 0
.gitignore

@@ -14,3 +14,5 @@ docs/tutorial/index.html
 dulwich.egg-info/
 .tox/
 .idea/
+.coverage
+htmlcov/

+ 7 - 0
Makefile

@@ -5,6 +5,7 @@ SETUP = $(PYTHON) setup.py
 PYDOCTOR ?= pydoctor
 TESTRUNNER ?= unittest
 RUNTEST = PYTHONHASHSEED=random PYTHONPATH=.:$(PYTHONPATH) $(PYTHON) -m $(TESTRUNNER) $(TEST_OPTIONS)
+COVERAGE = python3-coverage
 
 DESTDIR=/
 
@@ -58,3 +59,9 @@ pep8:
 
 before-push: check
 	git diff origin/master | $(PEP8) --diff
+
+coverage:
+	$(COVERAGE) run --source=dulwich -m unittest dulwich.tests.test_suite dulwich.contrib.test_suite
+
+coverage-html: coverage
+	$(COVERAGE) html