@@ -53,31 +53,36 @@ jobs:
53
53
sudo mv qemu/bin/qemu-system-xtensa /usr/local/bin/
54
54
sudo chmod +x /usr/local/bin/qemu-system-xtensa
55
55
56
+ - name : Build tests
57
+ run : |
58
+ # First just build the test firmware
59
+ platformio test --without-uploading --without-testing -e esp32-s3-devkitc-1-qemu
60
+
56
61
- name : Run tests with QEMU
57
62
run : |
58
- # Create a script to run tests with QEMU
59
- echo '#!/bin/bash
60
- qemu-system-xtensa \
63
+ # Create an empty flash file
64
+ dd if=/dev/zero of=flash.bin bs=1M count=4
65
+
66
+ # Run QEMU directly with the test firmware
67
+ timeout 300 qemu-system-xtensa \
61
68
-machine esp32s3 \
62
69
-nographic \
63
70
-drive file=flash.bin,if=mtd,format=raw \
64
71
-global driver=timer.esp32.timg,property=wdt_disable,value=true \
65
72
-kernel .pio/build/esp32-s3-devkitc-1/firmware.elf \
66
- -serial stdio' > run_tests.sh
67
- chmod +x run_tests.sh
68
-
69
- # Create an empty flash file
70
- dd if=/dev/zero of=flash.bin bs=1M count=4
73
+ -serial file:test_output.log \
74
+ 2>&1 | tee qemu_output.log &
71
75
72
- # Build and run tests
73
- platformio test -e esp32-s3-devkitc-1 2>&1 | tee test_output.log
76
+ # Give QEMU some time to run the tests
77
+ sleep 30
74
78
75
79
# Check test results
76
80
if grep -q "PASSED" test_output.log; then
77
81
echo "Tests passed successfully!"
78
82
exit 0
79
83
else
80
- echo "Tests failed!"
84
+ echo "Tests failed or didn't complete!"
85
+ cat test_output.log
81
86
exit 1
82
87
fi
83
88
88
93
name : test-results
89
94
path : |
90
95
test_output.log
91
- .pio/build/esp32-s3-devkitc-1/test_output.txt
96
+ qemu_output.log
97
+ .pio/build/esp32-s3-devkitc-1/firmware.elf
0 commit comments