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 <jan@janware.com>
This commit is contained in:
parent
ac54a7bca6
commit
52f34a915d
2 changed files with 8 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ include $(JWBDIR)/make/py-defs.mk
|
||||||
|
|
||||||
EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py))
|
EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py))
|
||||||
EXE_ARGS ?=
|
EXE_ARGS ?=
|
||||||
|
PYTHON_RUNNER ?= $(PYTHON)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
install:
|
install:
|
||||||
|
|
@ -13,7 +14,7 @@ distclean:
|
||||||
test: all
|
test: all
|
||||||
|
|
||||||
run:
|
run:
|
||||||
$(PYTHON) $(EXE) $(EXE_ARGS)
|
$(PYTHON_RUNNER) $(EXE) $(EXE_ARGS)
|
||||||
|
|
||||||
run.sh:
|
run.sh:
|
||||||
echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp
|
echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp
|
||||||
|
|
|
||||||
6
make/py-test.mk
Normal file
6
make/py-test.mk
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
PYTHON_RUNNER ?= pytest -v
|
||||||
|
|
||||||
|
include $(JWBDIR)/make/py-run.mk
|
||||||
|
|
||||||
|
all:
|
||||||
|
test: run
|
||||||
Loading…
Add table
Add a link
Reference in a new issue