Skip to content

Commit 8f2d7ad

Browse files
authored
Merge pull request #78 from jkonecny12/master-add-coverage-report
Add coverage support
2 parents deba26c + ae169d8 commit 8f2d7ad

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
*.pyc
22
.*.swp
33

4+
.coverage
5+
tests/coverage-report.log
6+
47
ChangeLog
58

69
po/*.gmo

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECNAME).spec)
2121
RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECNAME).spec | sed -e 's|%.*$$||g')
2222
TAG=$(PKGNAME)-$(VERSION)
2323

24-
PYTHON=python3
24+
PYTHON?=python3
25+
COVERAGE?=coverage3
2526

2627
# Arguments used for setup.py call for creating archive
2728
BUILD_ARGS ?= sdist bdist_wheel
@@ -52,6 +53,12 @@ test:
5253
@echo "*** Running unittests ***"
5354
PYTHONPATH=. $(PYTHON) -m unittest discover -v -s tests/ -p '*_test.py'
5455

56+
.PHONY: coverage
57+
coverage:
58+
@echo "*** Running unittests with coverage ***"
59+
PYTHONPATH=. $(COVERAGE) run --branch -m unittest discover -v -s tests/ -p '*_test.py'
60+
$(COVERAGE) report -m --include="simpleline/*" | tee tests/coverage-report.log
61+
5562
.PHONY: check
5663
check:
5764
@echo "*** Running pocketlint ***"

0 commit comments

Comments
 (0)