@@ -26,6 +26,9 @@ FROZEN_MANIFEST ?= variants/manifest.py
2626# This should be configured by the mpconfigvariant.mk
2727PROG ?= micropython
2828
29+ # For use in test rules below
30+ ABS_PROG = $(abspath $(BUILD ) /$(PROG ) )
31+
2932# qstr definitions (must come before including py.mk)
3033QSTR_DEFS += qstrdefsport.h
3134QSTR_GLOBAL_DEPENDENCIES += $(VARIANT_DIR ) /mpconfigvariant.h
@@ -257,16 +260,13 @@ include $(TOP)/py/mkrules.mk
257260.PHONY : test test_full_no_native test_full test//% test/% test-failures print-failures clean-failures
258261
259262test : $(BUILD ) /$(PROG ) $(TOP ) /tests/run-tests.py
260- $(eval DIRNAME=ports/$(notdir $(CURDIR ) ) )
261- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py
263+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py
262264
263265test//% : $(BUILD ) /$(PROG ) $(TOP ) /tests/run-tests.py
264- $(eval DIRNAME=ports/$(notdir $(CURDIR ) ) )
265- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py -i " $* "
266+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py -i " $* "
266267
267268test-failures : $(BUILD ) /$(PROG ) $(TOP ) /tests/run-tests.py
268- $(eval DIRNAME=ports/$(notdir $(CURDIR ) ) )
269- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py --run-failures
269+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py --run-failures
270270
271271print-failures :
272272 cd $(TOP ) /tests && ./run-tests.py --print-failures
@@ -275,18 +275,15 @@ clean-failures:
275275 cd $(TOP ) /tests && ./run-tests.py --clean-failures
276276
277277test/% : $(BUILD ) /$(PROG ) $(TOP ) /tests/run-tests.py
278- $(eval DIRNAME=ports/$(notdir $(CURDIR ) ) )
279- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py -d " $* "
278+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py -d " $* "
280279
281280test_full_no_native : $(BUILD ) /$(PROG ) $(TOP ) /tests/run-tests.py test
282- $(eval DIRNAME=ports/$(notdir $(CURDIR ) ) )
283- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS )
284- cat $(TOP ) /tests/basics/0prelim.py | ./$(BUILD ) /$(PROG ) | grep -q ' abc'
281+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS )
282+ cat $(TOP ) /tests/basics/0prelim.py | $(ABS_PROG ) | grep -q ' abc'
285283
286284test_full : $(BUILD ) /$(PROG ) $(TOP ) /tests/run-tests.py test_full_no_native
287- $(eval DIRNAME=ports/$(notdir $(CURDIR ) ) )
288- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py --emit native
289- cd $(TOP ) /tests && MICROPY_MICROPYTHON=../$(DIRNAME ) /$(BUILD ) /$(PROG ) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS ) --emit native
285+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py --emit native
286+ cd $(TOP ) /tests && MICROPY_MICROPYTHON=$(ABS_PROG ) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS ) --emit native
290287
291288test_gcov : test_full
292289 gcov -o $(BUILD ) /py $(TOP ) /py/* .c
0 commit comments