Skip to content
Snippets Groups Projects
Commit 47b32a1e authored by Jan Mach's avatar Jan Mach
Browse files

Added support for code test coverage calculations.

(Redmine issue: #3443)
parent a8f53676
No related branches found
No related tags found
No related merge requests found
[run]
source = ./lib
!.gitignore !.gitignore
.directory .directory
.coverage
*~ *~
*.aux *.aux
*.log *.log
......
...@@ -41,6 +41,7 @@ VENV_PATH ?= venv ...@@ -41,6 +41,7 @@ VENV_PATH ?= venv
PYTHON = python3 PYTHON = python3
PIP = pip PIP = pip
NOSETESTS = nosetests NOSETESTS = nosetests
COVERAGE = coverage
TWINE = twine TWINE = twine
PYBABEL = pybabel PYBABEL = pybabel
...@@ -149,6 +150,7 @@ help: ...@@ -149,6 +150,7 @@ help:
@echo " * $(GREEN)pyflakes$(NC): check project with pyflakes" @echo " * $(GREEN)pyflakes$(NC): check project with pyflakes"
@echo " * $(GREEN)pylint$(NC): check project with pylint" @echo " * $(GREEN)pylint$(NC): check project with pylint"
@echo " * $(GREEN)test$(NC): run unit tests with nosetest" @echo " * $(GREEN)test$(NC): run unit tests with nosetest"
@echo " * $(GREEN)coverage$(NC): check test code coverage with nosetest and coverage"
@echo "" @echo ""
@echo " * $(GREEN)build-webui$(NC): setup web interface locally" @echo " * $(GREEN)build-webui$(NC): setup web interface locally"
@echo " * $(GREEN)build-package-whl$(NC): actually generate Python package" @echo " * $(GREEN)build-package-whl$(NC): actually generate Python package"
...@@ -499,7 +501,7 @@ cpybabel-compile: FORCE ...@@ -499,7 +501,7 @@ cpybabel-compile: FORCE
$(PYBABEL) compile -d $${class}translations; \ $(PYBABEL) compile -d $${class}translations; \
done done
#\ #\
# Alternative solution that uses the hawat-cli utility: # Alternative solution that uses the hawat-cli utility:
# APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE) # APP_ROOT_PATH=$(shell realpath ./chroot) hawat-cli intl init $(INIT_LOCALE)
# #
...@@ -593,6 +595,11 @@ test: ...@@ -593,6 +595,11 @@ test:
@echo "Python version: `$(PYTHON) --version`" @echo "Python version: `$(PYTHON) --version`"
APP_ROOT_PATH=$(shell realpath ./chroot) PYTHONPATH=$(DIR_LIB) $(NOSETESTS) APP_ROOT_PATH=$(shell realpath ./chroot) PYTHONPATH=$(DIR_LIB) $(NOSETESTS)
coverage:
@echo "\n$(GREEN)*** Checking test code coverage with nosetests and coverage ***$(NC)\n"
@echo "Python version: `$(PYTHON) --version`"
APP_ROOT_PATH=$(shell realpath ./chroot) PYTHONPATH=$(DIR_LIB) $(COVERAGE) run -m nose
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
......
setuptools==41.6.0 setuptools==41.6.0
wheel==0.33.6 wheel==0.33.6
nose==1.3.7 nose==1.3.7
coverage==5.0.3
pyflakes==2.1.1 pyflakes==2.1.1
pylint==2.4.3 pylint==2.4.3
sphinx==2.2.1 sphinx==2.2.1
......
setuptools setuptools
wheel wheel
nose nose
coverage
pyflakes pyflakes
pylint pylint
sphinx sphinx
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment