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
RISC-V: Add automated QEMU testing #1801
Conversation
Nice! Would it make sense to run the |
A test suite would be nice, but I'm not sure it's the right answer. How do we build it? What happens if there is a bug in |
I would (inside .travis.yml for example) choose a fixed version of |
Is the qemu folder cached? |
I don't think so, I can see if I can. |
c0acae5
to
5683896
Compare
It should be cached now |
3e57f5c
to
727808b
Compare
727808b
to
3961330
Compare
4e0414d
to
5958e67
Compare
Ok, back to passing. I think I have addressed all comments. |
Do you think I can volunteer you @hudson-ayers and @lschuermann to convert this to github actions? All signs point to that being strictly better than travis...maybe we should just freeze and eventually deprecate our travis setup, and move all new CI development over. |
But we can also use this now, and switch at some later point. |
I'm happy to help with the swap as well |
Sure, here is a test: Tock-CI#10 . It seems to work pretty much as-is, with the caveat that both the travis build log and the github actions build log show |
This add two targets to the top level Makefile: - emulation-setup: Clones the latest QEMU from mainline and builds it for the RV32 platforms. We use master QEMU as it will soon have OpenTitan support. - emulation-check: Boot Tock in QEMU using the board's Makefile. We then do a simple test to see if we printed the "Entering main loop" string. This is based on what libtock-rs used to do (with the timeout command and grep). This should be moved across to a cargo test runner which is what libtock-rs does now. We just need to figure out a way to hook the test runner up with the board's Makefile (to run the QEMU args) to avoid code duplication and test what users will run. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
The fix for that is to change emulation-setup to use bash instead of sh (which will use dash on ubuntu): .PHONY: emulation-setup
emulation-setup: SHELL:=/usr/bin/env bash
emulation-setup:
@#Use the latest QEMU as it has OpenTitan support
@if [[ ! -d tools/qemu || ! -f tools/qemu/VERSION ]]; then \
# ... |
5958e67
to
f3f9627
Compare
I didn't notice that warning. I have pushed a fix. |
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.
bors r+
I agree that Travis is (hopefully) not long for this world, but this is good to have now
Build succeeded: |
Pull Request Overview
This starts the process of automating QEMU testing for certain targets.
Currently we just do very basic grep based testing. The idea is to move this to a more capable test-runner infrastructure. We want to make sure we utilise the
make qemu
target for each board to be as close as possible to user testing.Testing Strategy
Push to GitHub and have Travis run tests.
TODO or Help Wanted
Nothing TODO for this PR.
Once OT support is merged to mainline QEMU (patches are on list) we can add OpenTitan testing to this as well.
Future TODO is to use a test-runner and to have more complex test cases.
Documentation Updated
/docs
, or no updates are required.Formatting
make formatall
.