From 419b79e886e399f996fa1783c455923763c0185d Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Thu, 5 Oct 2017 15:44:39 +0300 Subject: [PATCH] Add make test target and update .gitignore also submit coverage report to Coveralls.io if environment is configured --- .gitignore | 3 +++ Makefile | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 70111ab8..72808ccc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ src/pylorax/version.py* _build/ tests/pylint/.pylint.d/ +__pycache__/ +.coverage +pylint-log diff --git a/Makefile b/Makefile index 4ae5f1d8..f07799e2 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,14 @@ check: @echo "*** Running pylint ***" PYTHONPATH=$(PYTHONPATH):./src/ ./tests/pylint/runpylint.py +test: + @echo "*** Running tests ***" + PYTHONPATH=$(PYTHONPATH):./src/ $(PYTHON) -m nose -v --with-coverage --cover-erase --cover-branches \ + --cover-package=pylorax --cover-package=bin --cover-package=sbin --cover-inclusive + coverage3 report -m + [ -f "/usr/bin/coveralls" ] && [ -n "$(COVERALLS_REPO_TOKEN)" ] && coveralls || echo + + clean: -rm -rf build src/pylorax/version.py @@ -51,4 +59,4 @@ local: @rm -rf /var/tmp/$(PKGNAME)-$(VERSION) @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" -ci: check +ci: check test