From 52f34a915d0b80100e174fad0f8a2968f9fbc27e Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 2 Jul 2026 14:49:08 +0200 Subject: [PATCH] py-test.mk: Add file Add a dedicated py-test.mk for running tests with pytest instead of python. The commit introduces a new variable PYTHON_RUNNER, which is then used by py-run.mk to do it's usual thing. Running pytest is similar enough to running Python programs to keep the rest of the machinery and prevent redundancy from creeping in. Signed-off-by: Jan Lindemann --- make/py-run.mk | 3 ++- make/py-test.mk | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 make/py-test.mk diff --git a/make/py-run.mk b/make/py-run.mk index 2c4d7950..43c210ed 100644 --- a/make/py-run.mk +++ b/make/py-run.mk @@ -5,6 +5,7 @@ include $(JWBDIR)/make/py-defs.mk EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py)) EXE_ARGS ?= +PYTHON_RUNNER ?= $(PYTHON) all: install: @@ -13,7 +14,7 @@ distclean: test: all run: - $(PYTHON) $(EXE) $(EXE_ARGS) + $(PYTHON_RUNNER) $(EXE) $(EXE_ARGS) run.sh: echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp diff --git a/make/py-test.mk b/make/py-test.mk new file mode 100644 index 00000000..3d77f7e0 --- /dev/null +++ b/make/py-test.mk @@ -0,0 +1,6 @@ +PYTHON_RUNNER ?= pytest -v + +include $(JWBDIR)/make/py-run.mk + +all: +test: run