Skip to content

Commit

Permalink
Mae rule for coverage of Python code
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbinns committed Oct 8, 2022
1 parent 28df4ff commit 286330f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ sqlite3ext.h
MANIFEST
MANIFEST.in.tmp
megatestresults/
coverage/
testdb
/.coverage
/htmlcov/
apsw.egg-info
/.ropeproject/
/.mypy_cache/
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tagpush:

clean:
make PYTHONPATH="`pwd`" VERSION=$(VERSION) -C doc clean
rm -rf dist build work/* megatestresults apsw.egg-info __pycache__ :memory: .mypy_cache .ropeproject
rm -rf dist build work/* megatestresults apsw.egg-info __pycache__ :memory: .mypy_cache .ropeproject htmlcov
mkdir dist
for i in 'vgcore.*' '.coverage' '*.pyc' '*.pyo' '*~' '*.o' '*.so' '*.dll' '*.pyd' '*.gcov' '*.gcda' '*.gcno' '*.orig' '*.tmp' 'testdb*' 'testextension.sqlext' ; do \
find . -type f -name "$$i" -print0 | xargs -0t --no-run-if-empty rm -f ; done
Expand Down Expand Up @@ -78,6 +78,18 @@ build_ext_debug:
coverage:
env $(PYTHON) setup.py fetch --version=$(SQLITEVERSION) --all && env APSW_PY_COVERAGE=t tools/coverage.sh

PYCOVERAGEOPTS=--source apsw --append

pycoverage:
-rm -rf .coverage htmlcov
$(PYTHON) -m coverage run $(PYCOVERAGEOPTS) -m apsw.tests
$(PYTHON) -m coverage run $(PYCOVERAGEOPTS) -m apsw ":memory:" .quit
$(PYTHON) -m coverage run $(PYCOVERAGEOPTS) -m apsw.speedtest --apsw --sqlite3
$(PYTHON) -m coverage run $(PYCOVERAGEOPTS) -m apsw.trace -o /dev/null --sql --rows --timestamps --thread example-code.py >/dev/null
$(PYTHON) -m coverage report -m
$(PYTHON) -m coverage html --title "APSW python coverage"
$(PYTHON) -m webbrowser -t htmlcov/index.html

test: build_ext
env PYTHONHASHSEED=random $(PYTHON) -m apsw.tests

Expand Down

0 comments on commit 286330f

Please sign in to comment.