1- help = sed -n "/^$1/ { x ; p ; } ; s/\# \#/[⚙]/ ; s/\./.../ ; x" ${MAKEFILE_LIST}
2- python_packages := $(shell python -c "import sysconfig; print(sysconfig.get_paths() [\"purelib\"])")
3- country_template := openfisca_country_template
4- extension_template := openfisca_extension_template
1+ help = sed -n "/^$1/ { x ; p ; } ; s/\# \#/[⚙]/ ; s/\./…/ ; x" ${MAKEFILE_LIST}
2+ python_packages = $(shell python -c "import sysconfig; print(sysconfig.get_paths() [\"purelib\"])")
53
64# # Same as `make test`.
75all : test
@@ -53,11 +51,7 @@ check-types: openfisca_core openfisca_web_api
5351 @mypy $?
5452
5553# # Run openfisca-core & country/extension template tests.
56- test :: clean check-syntax-errors check-style check-types
57- test :: \
58- $(shell git ls-files "tests/* .py") \
59- ${python_packages} /${country_template} /tests \
60- ${python_packages} /${extension_template} /tests
54+ test : clean check-syntax-errors check-style check-types
6155 @# # Usage:
6256 @# #
6357 @# # make test [pytest_args="--ARG"] [openfisca_args="--ARG"]
@@ -68,16 +62,26 @@ test:: \
6862 @# # make test pytest_args="--exitfirst"
6963 @# # make test openfisca_args="--performance"
7064 @# # make test pytest_args="--exitfirst" openfisca_args="--performance"
65+ @# #
66+ @$(call help,$@ :)
67+ @${MAKE} test.core
68+ @${MAKE} test.country
69+ @${MAKE} test.extension
70+
71+ # Run openfisca-core tests.
72+ test.core : $(shell git ls-files "tests/* .py")
73+ @$(call help,$@ :)
74+ @PYTEST_ADDOPTS=" ${PYTEST_ADDOPTS} --cov=openfisca_core ${pytest_args} " openfisca test $?
75+
76+ # Run country-template tests.
77+ test.country : ${python_packages}/openfisca_country_template/tests
78+ @$(call help,$@ :)
79+ @PYTEST_ADDOPTS=" ${PYTEST_ADDOPTS} ${pytest_args} " openfisca test $? --country-package openfisca_country_template ${openfisca_args}
80+
81+ # Run extension-template tests.
82+ test.extension : ${python_packages}/openfisca_extension_template/tests
7183 @$(call help,$@ :)
72- @PYTEST_ADDOPTS=" \
73- ${PYTEST_ADDOPTS} \
74- --cov=openfisca_core \
75- ${pytest_args} \
76- " \
77- openfisca test $? \
78- --country-package ${country_template} \
79- --extensions ${extension_template} \
80- ${openfisca_args}
84+ @PYTEST_ADDOPTS=" ${PYTEST_ADDOPTS} ${pytest_args} " openfisca test $? --country-package openfisca_country_template --extensions openfisca_extension_template ${openfisca_args}
8185
8286# # Serve the openfisca Web API.
8387api :
0 commit comments