diff --git a/.murdock b/.murdock index 6ed386475d..6536d8e927 100755 --- a/.murdock +++ b/.murdock @@ -270,7 +270,12 @@ run_test() { print_worker echo "-- executing tests for $appdir on $board (compiled with $toolchain toolchain):" hook run_test_pre - BOARD=$board TOOLCHAIN=${toolchain} make -C$appdir flash-only test + + # do flashing and building of termdeps simultaneously + BOARD=$board TOOLCHAIN=${toolchain} make -C$appdir flash-only termdeps -j2 + + # now run the actual test + BOARD=$board TOOLCHAIN=${toolchain} make -C$appdir test RES=$? if [ $RES -eq 0 -a -n "$TEST_HASH" ]; then diff --git a/Makefile.include b/Makefile.include index 4011cb0d8a..37509aacbb 100644 --- a/Makefile.include +++ b/Makefile.include @@ -399,7 +399,7 @@ include $(RIOTMAKE)/bindist.inc.mk include $(RIOTMAKE)/modules.inc.mk -.PHONY: all link clean flash flash-only term doc debug debug-server reset objdump help info-modules +.PHONY: all link clean flash flash-only termdeps term doc debug debug-server reset objdump help info-modules .PHONY: print-size elffile binfile hexfile flashfile .PHONY: ..in-docker-container @@ -559,6 +559,8 @@ flash-only: $(FLASHDEPS) preflash: $(BUILD_BEFORE_FLASH) $(PREFLASHER) $(PREFFLAGS) +termdeps: $(TERMDEPS) + term: $(filter flash, $(MAKECMDGOALS)) $(TERMDEPS) $(call check_cmd,$(TERMPROG),Terminal program) $(TERMPROG) $(TERMFLAGS) @@ -588,6 +590,16 @@ reset: .PHONY: test test/available TESTS ?= $(foreach file,$(wildcard $(APPDIR)/tests/*[^~]),\ $(shell test -f $(file) -a -x $(file) && echo $(file))) + +# "make test" calls "make term" which would implicitly build it's dependencies, +# but that increases the time "make test" needs to get ready. That can cause +# problems ("make term" missing some lines) as terminal startup is not properly +# sychronized, but depends on a static timeout (TESTRUNNER_START_DELAY). +# Murdock builds the term dependencies before running "make test" to circumvent +# this. In order to make local builds behave similar, add the term deps here. +# See #11762. +TEST_DEPS += $(TERMDEPS) + test: $(TEST_DEPS) $(Q) for t in $(TESTS); do \ $$t || exit 1; \