Skip to content

Commit

Permalink
Merge branch 'floitsch/run-hw-tests.25.board12' into floitsch/run-hw-…
Browse files Browse the repository at this point in the history
…tests.30.ci-esp32
  • Loading branch information
floitsch committed Dec 17, 2024
2 parents eb8963c + 2fbe625 commit b43bff7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -306,17 +306,27 @@ install: install-sdk
test:
(cd $(BUILD)/$(HOST) && ninja check_slow check_fuzzer_lib)

.PHONY: test-hw
test-hw:
.PHONY: rebuild-cmake-hw
rebuild-cmake-hw:
@if [ -z "$$TOIT_EXE_HW" ]; then \
echo "TOIT_EXE_HW is not set."; \
exit 1; \
fi
mkdir -p $(BUILD)/hw
(cd $(BUILD)/hw && cmake -DTOIT_EXE_HW=$$TOIT_EXE_HW -G Ninja $(CURDIR)/tests/hw)

.PHONY: download-packages-hw-host
download-packages-hw-host:
cmake -E env TOIT_EXE_HW=$(BUILD)/$(HOST)/sdk/bin/toit $(MAKE) download-packages-hw

.PHONY: download-packages-hw
download-packages-hw:
$$TOIT_EXE_HW pkg install --project-root tests/hw/pi
$$TOIT_EXE_HW pkg install --project-root tests/hw/esp32
$$TOIT_EXE_HW pkg install --project-root tests/hw/esp-tester

.PHONY: test-hw
test-hw: rebuild-cmake-hw download-packages-hw
(cd $(BUILD)/hw && ninja check_hw)

.PHONY: build-test-assets
Expand All @@ -340,12 +350,12 @@ update-gold:
(cd $(BUILD)/$(HOST) && ninja update_type_gold)

.PHONY: test-health
test-health: download-packages
test-health: download-packages download-packages-hw-host
$(MAKE) rebuild-cmake
(cd $(BUILD)/$(HOST) && ninja check_health)

.PHONY: update-health-gold
update-health-gold: download-packages
update-health-gold: download-packages download-packages-hw-host
$(MAKE) rebuild-cmake
(cd $(BUILD)/$(HOST) && ninja clear_health_gold)
(cd $(BUILD)/$(HOST) && ninja update_health_gold)
Expand Down
4 changes: 3 additions & 1 deletion tests/hw/esp-tester/mini-jag.toit
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import net
import system.containers
import uuid show Uuid

import .shared

main:
cause := esp32.wakeup-cause
print "Wakeup cause: $cause"
Expand All @@ -28,7 +30,7 @@ install-new-test:
network := net.open
server-socket := network.tcp-listen 0
print "$network.address:$server-socket.local-address.port"
print "MINI-JAG LISTENING"
print MINI-JAG-LISTENING
socket := server-socket.accept
reader := socket.in
size := reader.little-endian.read-int32
Expand Down
6 changes: 2 additions & 4 deletions tests/hw/esp-tester/tester.toit
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import system
import uart
import .shared

MINI-JAG-LISTENING ::= "MINI-JAG LISTENING"
TEST-STARTED ::= "TEST STARTED"
ALL-TEST-DONE ::= "All tests done"
ALL-TESTS-DONE ::= "All tests done"
JAG-DECODE ::= "jag decode"

main args:
Expand Down Expand Up @@ -144,7 +142,7 @@ class TestDevice:
collected-output += data.to-string-non-throwing
if not ready-latch.has-value and collected-output.contains "\n$MINI-JAG-LISTENING":
ready-latch.set true
if not all-tests-done.has-value and collected-output.contains ALL-TEST-DONE:
if not all-tests-done.has-value and collected-output.contains ALL-TESTS-DONE:
all-tests-done.set true
if collected-output.contains JAG-DECODE:
ui.abort "Error detected"
Expand Down
2 changes: 1 addition & 1 deletion tests/hw/esp32/uart-rs485-board2.toit
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test:
task --background::
sleep --ms=2000
print "Timeout"
print "Board1 must be started before board1"
print "Board1 must be started before board2."

task::
5.repeat:
Expand Down

0 comments on commit b43bff7

Please sign in to comment.