jw-pkg/make/py-test.mk

23 lines
557 B
Makefile
Raw Normal View History

PY_CONFTEST ?= conftest.py
PY_UPDATE_PY_CONFTEST ?= true
ifeq ($(PY_UPDATE_PY_CONFTEST),true)
PY_GENERATED += $(PY_CONFTEST)
endif
PY_CONFTEST_CMD ?= /bin/bash $(JWB_SCRIPT_DIR)/python-tools.sh create-conftest-py
PY_TEST_ARGS ?= -v
PYTHON_RUNNER := pytest $(PY_TEST_ARGS)
include $(JWBDIR)/make/py-run.mk
all:
test: run
run: $(PY_GENERATED)
$(PY_CONFTEST):
$(PY_CONFTEST_CMD) > $@.tmp
mv $@.tmp $@
clean: clean.py-test
clean.py-test:
rm -rf $(PY_GENERATED) .pytest-cache