Skip to content

Commit fc25b0b

Browse files
author
Mauko Quiroga
committed
Reorganise make files
1 parent 483e736 commit fc25b0b

3 files changed

Lines changed: 34 additions & 30 deletions

File tree

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
include openfisca_make/build.mk
22
include openfisca_make/install.mk
33
include openfisca_make/lint.mk
4-
include openfisca_make/test.mk
54
include openfisca_make/serve.mk
5+
include openfisca_make/test_code.mk
6+
include openfisca_make/test_doc.mk
67

78
help = sed -n "/^$1/ { x ; p ; } ; s/\#\#/[⚙]/ ; s/\./.../ ; x" ${MAKEFILE_LIST}
89

910
.DEFAULT_GOAL := all
1011

1112
## Same as `make test`.
1213
all: test
14+
15+
## Run all lints and tests.
16+
test: clean lint test-code

openfisca_make/test_code.mk

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])")
2+
3+
## Run openfisca-core & country/extension template tests.
4+
test-code: test-core test-country test-extension
5+
@## Usage:
6+
@##
7+
@## make test [pytest_args="--ARG"] [openfisca_args="--ARG"]
8+
@##
9+
@## Examples:
10+
@##
11+
@## make test
12+
@## make test pytest_args="--exitfirst"
13+
@## make test openfisca_args="--performance"
14+
@## make test pytest_args="--exitfirst" openfisca_args="--performance"
15+
16+
## Run openfisca-core tests.
17+
test-core: $(shell git ls-files "tests/*.py")
18+
@$(call help,$@:)
19+
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=openfisca_core ${pytest_args}" openfisca test $? ${openfisca_args}
20+
21+
## Run country-template tests.
22+
test-country:
23+
@$(call help,$@:)
24+
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} ${pytest_args}" openfisca test ${python_packages}/openfisca_country_template/tests --country-package openfisca_country_template ${openfisca_args}
25+
26+
## Run extension-template tests.
27+
test-extension:
28+
@$(call help,$@:)
29+
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} ${pytest_args}" openfisca test ${python_packages}/openfisca_extension_template/tests --country-package openfisca_country_template --extensions openfisca_extension_template ${openfisca_args}
Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
repo = https://github.com/openfisca/openfisca-doc
22
branch = $(shell git branch --show-current)
3-
python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths()[\"purelib\"])")
4-
5-
## Run openfisca-core & country/extension template tests.
6-
test: clean check-syntax-errors check-style check-types test-core test-country test-extension
7-
@## Usage:
8-
@##
9-
@## make test [pytest_args="--ARG"] [openfisca_args="--ARG"]
10-
@##
11-
@## Examples:
12-
@##
13-
@## make test
14-
@## make test pytest_args="--exitfirst"
15-
@## make test openfisca_args="--performance"
16-
@## make test pytest_args="--exitfirst" openfisca_args="--performance"
17-
18-
## Run openfisca-core tests.
19-
test-core: $(shell git ls-files "tests/*.py")
20-
@$(call help,$@:)
21-
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=openfisca_core ${pytest_args}" openfisca test $? ${openfisca_args}
22-
23-
## Run country-template tests.
24-
test-country: ${python_packages}/openfisca_country_template/tests
25-
@$(call help,$@:)
26-
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} ${pytest_args}" openfisca test $? --country-package openfisca_country_template ${openfisca_args}
27-
28-
## Run extension-template tests.
29-
test-extension: ${python_packages}/openfisca_extension_template/tests
30-
@$(call help,$@:)
31-
@PYTEST_ADDOPTS="${PYTEST_ADDOPTS} ${pytest_args}" openfisca test $? --country-package openfisca_country_template --extensions openfisca_extension_template ${openfisca_args}
323

334
## Check that the current changes do not break the doc.
345
test-doc:

0 commit comments

Comments
 (0)