-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Renode-based tests of Arduino examples #61
Open
robertszczepanski
wants to merge
3
commits into
tensorflow:main
Choose a base branch
from
antmicro:28656-Add_test_build_with_renode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,22 @@ jobs: | |
name: Arduino CLI Build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Test | ||
run: | | ||
./scripts/install_arduino_cli.sh | ||
./scripts/test_arduino_library.sh "${PWD}" | ||
|
||
- name: Apply serial patch on tflite-micro | ||
run: | | ||
sed --in-place '/#define DEBUG_SERIAL_OBJECT/s/(Serial)/(Serial1)/' src/tensorflow/lite/micro/system_setup.cpp | ||
|
||
- name: Build patched binaries | ||
run: | | ||
./scripts/test_arduino_library.sh "${PWD}" | ||
|
||
- name: Test patched builds in Renode | ||
uses: antmicro/[email protected] | ||
with: | ||
renode-version: '1.12.0+20210914gitc77eea21' | ||
tests-to-run: 'examples/**/*.robot' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
*** Settings *** | ||
Suite Setup Setup | ||
Suite Teardown Teardown | ||
Test Setup Reset Emulation | ||
Test Teardown Test Teardown | ||
Resource ${RENODEKEYWORDS} | ||
|
||
*** Variables *** | ||
${UART} sysbus.uart0 | ||
|
||
*** Keywords *** | ||
Create Machine | ||
Execute Command mach create | ||
Execute Command machine LoadPlatformDescription @platforms/boards/arduino_nano_33_ble.repl | ||
|
||
Execute Command sysbus LoadELF @${CURDIR}/output/hello_world.ino.elf | ||
|
||
*** Test Cases *** | ||
Should Print Brightness Sequence | ||
Create Machine | ||
Create Terminal Tester ${UART} | ||
|
||
Execute Command machine EnableProfiler @${CURDIR}/hello_world.dump | ||
Start Emulation | ||
|
||
Wait For Line On Uart 127 | ||
Wait For Line On Uart 260 | ||
Wait For Line On Uart 205 | ||
Wait For Line On Uart 195 | ||
Wait For Line On Uart 10 | ||
Wait For Line On Uart 1 | ||
Wait For Line On Uart 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
*** Settings *** | ||
Suite Setup Setup | ||
Suite Teardown Teardown | ||
Test Setup Reset Emulation | ||
Test Teardown Test Teardown | ||
Resource ${RENODEKEYWORDS} | ||
|
||
*** Variables *** | ||
${UART} sysbus.uart0 | ||
|
||
*** Keywords *** | ||
Create Machine | ||
Execute Command mach create | ||
Execute Command machine LoadPlatformDescription @platforms/boards/arduino_nano_33_ble.repl | ||
|
||
Execute Command sysbus LoadELF @${CURDIR}/output/magic_wand.ino.elf | ||
|
||
*** Test Cases *** | ||
Should Detect RING Motion | ||
Create Machine | ||
Create Terminal Tester ${UART} | ||
|
||
Execute Command sysbus.twi0.lsm9ds1_imu FeedAccelerationSample @${CURDIR}/test_files/circle_rotated.data | ||
|
||
Execute Command machine EnableProfiler "${CURDIR}/magic_wand_ring.dump" | ||
Start Emulation | ||
Wait For Line On Uart Magic starts | ||
Wait For Line On Uart RING: | ||
|
||
Should Detect SLOPE Motion | ||
Create Machine | ||
Create Terminal Tester ${UART} | ||
|
||
Execute Command sysbus.twi0.lsm9ds1_imu FeedAccelerationSample @${CURDIR}/test_files/angle_rotated.data | ||
|
||
Execute Command machine EnableProfiler "${CURDIR}/magic_wand_slope.dump" | ||
Start Emulation | ||
Wait For Line On Uart Magic starts | ||
Wait For Line On Uart SLOPE: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@advaitjain this is due to a limitation in Renode. Right now we do not support the USB output, but it is already implemented. We need to review it and release. So we treat this as a temporary workaround.