From 88a2230fb77bba57b76744ce353884f3748f55f5 Mon Sep 17 00:00:00 2001 From: Alexander Lenz Date: Wed, 13 Sep 2017 18:45:16 +0200 Subject: [PATCH] Makefile: add convenience targets. Change-Id: I3e8fcb6d7db87c6b85dc03b801103f41e199c11c --- .gitignore | 4 ++++ Makefile | 37 +++++++++++++++++++++++-------------- requirements-dev.txt | 1 + 3 files changed, 28 insertions(+), 14 deletions(-) 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