forked from AndreaCensi/contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pypackage.mk
50 lines (36 loc) · 1.19 KB
/
pypackage.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Generic Makefile for python package providing testing/installation.
# (common version)
.PHONY: docs all develop test
all: develop
develop:
python setup.py develop
docs:
make -C docs
coverage_dir=coverage_information
nose=nosetests --with-id
nose_parallel=--processes=16 --process-timeout=300 --process-restartworker
nose_coverage=--with-coverage --cover-html --cover-html-dir $(coverage_dir) --cover-package=$(package)
test:
@echo Overview for running tests for package $(package):
@echo
@echo - Use 'make test-failed' to redo only failed tests
@echo - Use 'make test-parallel' to enable parallel testing
@echo - Use 'make test-coverage' to do coverage testing
@echo - Use the env. var. NOSE_PARAMS to pass extra arguments.
@echo
@echo For example:
@echo NOSE_PARAMS='--nologcapture -s -v' make test-failed
@echo
@echo
$(nose) $(package) $(NOSE_PARAMS)
NOSE_PARAMS?=
test-stop:
$(nose) $(package) $(NOSE_PARAMS) -x
test-failed:
$(nose) $(package) $(NOSE_PARAMS) --failed
test-parallel:
$(nose) $(package) $(NOSE_PARAMS) $(nose_parallel)
test-parallel-stop:
$(nose) $(package) $(NOSE_PARAMS) $(nose_parallel) -x
test-coverage:
$(nose) $(package) $(NOSE_PARAMS) $(nose_coverage)