diff --git a/.gitignore b/.gitignore index 7394a38..9be3a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,7 @@ doc/_build # Mac .DS_Store + +# pytest +.cache +.coverage diff --git a/Makefile b/Makefile index 4a087e0..73f30d5 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,5 @@ -.PHONY: all doc clean test - all: clean doc -clean: - @echo "cleaning pyc files" - @find . -name '*.pyc' -delete - @echo "cleaning html tree" - @rm -rf html - @mkdir html - -doc: - $(MAKE) -C doc html - demo: @bin/secop-server -q demo & @bin/secop-server -q test & @@ -19,6 +7,27 @@ demo: @bin/secop-gui localhost:10767 localhost:10768 localhost:10769 @ps aux|grep [s]ecop-server|awk '{print $$2}'|xargs kill +build: + python setup.py build + +clean: + find . -name '*.pyc' -delete + rm -rf build + $(MAKE) -C doc clean + +install: build + python setup.py install + test: - #@pytest -v --lf -l --tb=auto --setup-plan test/ - @pytest -v --lf -l --tb=long --setup-show test/ + python $(shell which pytest) -v test + +test-verbose: + python $(shell which pytest) -v test -s + +test-coverage: + python $(shell which pytest) -v test --cov=secop + +doc: + $(MAKE) -C doc html + +.PHONY: doc clean test test-verbose test-coverage demo diff --git a/requirements-dev.txt b/requirements-dev.txt index f338b22..b7af5fb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,3 +4,4 @@ Sphinx>=1.2.1 # test suite pytest pytest-randomly>=1.1 +pytest-cov