mirror of
https://github.com/micropython/micropython.git
synced 2025-07-21 04:51:12 +02:00
tools/ci.sh: Fix nanbox CI test runs.
This commit fixes CI test runs for the `nanbox` target, which were broken by the unconditional native emitter code output changes in the test runner. The `nanbox` configuration does not enable native emitters of any kind, and with a full test run that includes executing emitted native code things would break when doing CI runs. This is worked around by introducing a common subset of tests that do not involve the native emitter, and a more comprehensive set of tests that include both non-emitter and emitter tests. The `nanbox` CI test run will stop at the first subset, whilst other configurations will run that and execute further tests. Function names have been kept the same for steps that involve native code, with the `nanbox` subset having another one. This should not trigger any breakage in existing CI configurations or external scripts. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit is contained in:
committed by
Damien George
parent
c1c73d966e
commit
0da22b2c30
@@ -256,21 +256,24 @@ endif
|
||||
|
||||
include $(TOP)/py/mkrules.mk
|
||||
|
||||
.PHONY: test test_full
|
||||
.PHONY: test test_full_no_native test_full
|
||||
|
||||
test: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
|
||||
$(eval DIRNAME=ports/$(notdir $(CURDIR)))
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py
|
||||
|
||||
test_full: $(BUILD)/$(PROG) $(TOP)/tests/run-tests.py
|
||||
test_full_no_native: $(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=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py -d thread
|
||||
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) -d basics float micropython
|
||||
cd $(TOP)/tests && MICROPY_MICROPYTHON=../$(DIRNAME)/$(BUILD)/$(PROG) ./run-tests.py --via-mpy $(RUN_TESTS_MPY_CROSS_FLAGS) --emit native -d basics float micropython
|
||||
cat $(TOP)/tests/basics/0prelim.py | ./$(BUILD)/$(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 -d basics float micropython
|
||||
|
||||
test_gcov: test_full
|
||||
gcov -o $(BUILD)/py $(TOP)/py/*.c
|
||||
gcov -o $(BUILD)/extmod $(TOP)/extmod/*.c
|
||||
|
19
tools/ci.sh
19
tools/ci.sh
@@ -527,13 +527,26 @@ function ci_unix_run_tests_helper {
|
||||
make -C ports/unix "$@" test
|
||||
}
|
||||
|
||||
function ci_unix_run_tests_full_extra {
|
||||
micropython=$1
|
||||
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-multitests.py multi_net/*.py)
|
||||
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-perfbench.py 1000 1000)
|
||||
}
|
||||
|
||||
function ci_unix_run_tests_full_no_native_helper {
|
||||
variant=$1
|
||||
shift
|
||||
micropython=../ports/unix/build-$variant/micropython
|
||||
make -C ports/unix VARIANT=$variant "$@" test_full_no_native
|
||||
ci_unix_run_tests_full_extra $micropython
|
||||
}
|
||||
|
||||
function ci_unix_run_tests_full_helper {
|
||||
variant=$1
|
||||
shift
|
||||
micropython=../ports/unix/build-$variant/micropython
|
||||
make -C ports/unix VARIANT=$variant "$@" test_full
|
||||
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-multitests.py multi_net/*.py)
|
||||
(cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=$micropython ./run-perfbench.py 1000 1000)
|
||||
ci_unix_run_tests_full_extra $micropython
|
||||
}
|
||||
|
||||
function ci_native_mpy_modules_build {
|
||||
@@ -673,7 +686,7 @@ function ci_unix_nanbox_build {
|
||||
}
|
||||
|
||||
function ci_unix_nanbox_run_tests {
|
||||
ci_unix_run_tests_full_helper nanbox PYTHON=python2.7
|
||||
ci_unix_run_tests_full_no_native_helper nanbox PYTHON=python2.7
|
||||
}
|
||||
|
||||
function ci_unix_float_build {
|
||||
|
Reference in New Issue
Block a user