improve test and clean targets in Makefiles

This commit is contained in:
Yuming Zhu 2017-11-30 09:47:32 +00:00 committed by Tomas Kopecek
parent aa48b87c12
commit 7a6ebc851f
13 changed files with 39 additions and 9 deletions

View file

@ -1,6 +1,8 @@
[run]
data_file = .coverage2
omit =
setup.py
/usr/*
tests/*
@ -8,3 +10,6 @@ omit =
exclude_lines =
pragma: no cover
no cover: 2.x
[html]
directory = htmlcov/py2

View file

@ -1,8 +1,10 @@
[run]
data_file = .coverage3
; extra omissions for py3 for now
omit =
setup.py
/usr/*
tests/*
@ -11,3 +13,6 @@ exclude_lines =
pragma: no cover
no cover 3.x
if six.PY2
[html]
directory = htmlcov/py3

1
.gitignore vendored
View file

@ -10,6 +10,7 @@ util/koji-shadowc
#
# coverage artifacts
.coverage
.coverage[23]
htmlcov/
*,cover
#

View file

@ -61,29 +61,39 @@ _default:
clean:
rm -f *.o *.so *.pyc *~ koji*.bz2 koji*.src.rpm
rm -rf __pycache__
rm -rf devtools/fakehubc devtools/fakewebc devtools/__pycache__
rm -rf koji-$(VERSION)
for d in $(SUBDIRS); do make -s -C $$d clean; done
coverage erase ||:
find ./tests -name "__pycache__" -exec rm -rf {} \; ||:
find ./tests -name "*.pyc" -exec rm -f {} \;
rm -rf docs/source/__pycache__ docs/source/*.pyc
coverage2 erase ||:
coverage3 erase --rcfile .coveragerc3 ||:
rm -rf htmlcov
git-clean:
@git clean -d -q -x
test:
test: test2 test3
@echo "All tests are finished for python 2&3"
test2:
coverage2 erase
PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/.:www/lib coverage2 run \
--source . /usr/bin/nosetests
coverage2 report
coverage2 html
@echo Full coverage report at file://$(CURDIR)/htmlcov/index.html
@echo Full coverage report at file://${CURDIR}/htmlcov/py2/index.html
test3:
coverage3 erase
coverage3 erase --rcfile .coveragerc3
PYTHONPATH=hub/.:plugins/hub/.:plugins/builder/.:plugins/cli/.:cli/.:www/lib coverage3 run \
--rcfile .coveragerc3 --source . \
/usr/bin/nosetests-3
coverage3 report --rcfile .coveragerc3
coverage3 html --rcfile .coveragerc3
@echo Full coverage report at file://$(CURDIR)/htmlcov/index.html
coverage report --rcfile .coveragerc3
coverage html --rcfile .coveragerc3
@echo Full coverage report at file://${CURDIR}/htmlcov/py3/index.html
test-tarball:
@rm -rf .koji-$(VERSION)

View file

@ -8,6 +8,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~ kojidc
rm -rf __pycache__
_install:

View file

@ -13,6 +13,8 @@ _default:
clean:
rm -f *.o *.so *.pyc *~ kojic
rm -rf __pycache__
for d in $(SUBDIRS); do make -s -C $$d clean; done
install:
@if [ "$(DESTDIR)" = "" ]; then \

View file

@ -11,6 +11,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~
rm -rf __pycache__
install:
@if [ "$(DESTDIR)" = "" ]; then \

View file

@ -13,6 +13,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~
rm -rf __pycache__
install:
@if [ "$(DESTDIR)" = "" ]; then \

View file

@ -12,7 +12,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~
for d in $(SUBDIRS); do make -s -C $$d clean; done
rm -rf __pycache__
install:
mkdir -p $(DESTDIR)/$(PKGDIR)

View file

@ -21,7 +21,8 @@ _default:
@echo "nothing to make. try make install"
clean:
rm -f *.o *.so *.pyc *.pyo *~
find . -name "__pycache__" -exec rm -rf {} \; ||:
find . -name "*.pyc" -exec rm -f {} \;
install:
@if [ "$(DESTDIR)" = "" ]; then \

View file

@ -7,6 +7,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~
rm -rf __pycache__
for b in $(BINFILES); do rm -f $${b}c; done
_install:

View file

@ -8,6 +8,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~
rm -rf __pycache__
for d in $(SUBDIRS); do make -s -C $$d clean; done
install:

View file

@ -13,6 +13,7 @@ _default:
clean:
rm -f *.o *.so *.pyc *~
rm -rf __pycache__
for d in $(SUBDIRS); do make -s -C $$d clean; done
install: