From 7955734aca3a39e74b9a82017f091bdd4d236c53 Mon Sep 17 00:00:00 2001 From: stijn Date: Thu, 25 Nov 2021 11:33:35 +0100 Subject: [PATCH] windows: Run tests via Makefile. The application isn't necessarily called 'micropython' especially not When using variants, i.e. the tests need to be ran using $(PROG). --- ports/windows/.appveyor.yml | 13 ++----------- ports/windows/Makefile | 12 ++++++++++++ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ports/windows/.appveyor.yml b/ports/windows/.appveyor.yml index 40fdff2934..d412e0f168 100644 --- a/ports/windows/.appveyor.yml +++ b/ports/windows/.appveyor.yml @@ -67,17 +67,8 @@ after_test: if ($LASTEXITCODE -ne 0) { throw "$env:MSYSTEM mpy_cross build exited with code $LASTEXITCODE" } - cd (Join-Path $env:APPVEYOR_BUILD_FOLDER 'tests') - $testArgs = @('run-tests.py') - foreach ($skipTest in @('math_fun', 'float2int_double', 'float_parse', 'math_domain_special')) { - $testArgs = $testArgs + '-e' + $skipTest - } - & $env:MICROPY_CPYTHON3 $testArgs - if ($LASTEXITCODE -ne 0) { - & $env:MICROPY_CPYTHON3 run-tests.py --print-failures - throw "Test failure" - } - & $env:MICROPY_CPYTHON3 ($testArgs + @('--via-mpy', '-d', 'basics', 'float', 'micropython')) + cd (Join-Path $env:APPVEYOR_BUILD_FOLDER 'ports/windows') + C:\msys64\usr\bin\bash.exe -l -c "make V=1 test_full" if ($LASTEXITCODE -ne 0) { & $env:MICROPY_CPYTHON3 run-tests.py --print-failures throw "Test failure" diff --git a/ports/windows/Makefile b/ports/windows/Makefile index b1d2d35c9a..4aceeb981c 100644 --- a/ports/windows/Makefile +++ b/ports/windows/Makefile @@ -81,3 +81,15 @@ CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool -DMICROPY_MODULE_F endif include $(TOP)/py/mkrules.mk + +.PHONY: test test_full + +RUN_TESTS_SKIP += -e math_fun -e float2int_double -e float_parse -e math_domain_special + +test: $(PROG) $(TOP)/tests/run-tests.py + $(eval DIRNAME=ports/$(notdir $(CURDIR))) + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) $(PYTHON) ./run-tests.py $(RUN_TESTS_SKIP) + +test_full: test + $(eval DIRNAME=ports/$(notdir $(CURDIR))) + cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(PROG) $(PYTHON) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS) $(RUN_TESTS_SKIP) -d basics float micropython