mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 09:50:15 +01:00
unix/Makefile: Allow out-of-tree tests.
This allows out-of-tree tests like:
$ make -C ports/unix/ BUILD=/tmp MICROPY_MPYCROSS=~/bin/mpy-cross test
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
committed by
Damien George
parent
6729493531
commit
8204f9e8c3
@@ -26,6 +26,9 @@ FROZEN_MANIFEST ?= variants/manifest.py
|
||||
# This should be configured by the mpconfigvariant.mk
|
||||
PROG ?= micropython
|
||||
|
||||
# For use in test rules below
|
||||
ABS_PROG = $(abspath $(BUILD)/$(PROG))
|
||||
|
||||
# qstr definitions (must come before including py.mk)
|
||||
QSTR_DEFS += qstrdefsport.h
|
||||
QSTR_GLOBAL_DEPENDENCIES += $(VARIANT_DIR)/mpconfigvariant.h
|
||||
@@ -257,16 +260,13 @@ include $(TOP)/py/mkrules.mk
|
||||
.PHONY: test test_full_no_native test_full test//% test/% test-failures print-failures clean-failures
|
||||
|
||||
test: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py
|
||||
|
||||
test//%: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py -i "$*"
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py -i "$*"
|
||||
|
||||
test-failures: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py --run-failures
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py --run-failures
|
||||
|
||||
print-failures:
|
||||
cd $(TOP)/tests && ./run-tests.py --print-failures
|
||||
@@ -275,18 +275,15 @@ clean-failures:
|
||||
cd $(TOP)/tests && ./run-tests.py --clean-failures
|
||||
|
||||
test/%: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py -d "$*"
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py -d "$*"
|
||||
|
||||
test_full_no_native: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py test
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS)
|
||||
cat $(TOP)/tests/basics/0prelim.py | ./$(BUILD)/$(PROG) | grep -q 'abc'
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS)
|
||||
cat $(TOP)/tests/basics/0prelim.py | $(ABS_PROG) | grep -q 'abc'
|
||||
|
||||
test_full: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py test_full_no_native
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py --emit native
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS) --emit native
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py --emit native
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=$(ABS_PROG) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS) --emit native
|
||||
|
||||
test_gcov: test_full
|
||||
gcov -o $(BUILD)/py $(TOP)/py/*.c
|
||||
|
||||
Reference in New Issue
Block a user