-
Notifications
You must be signed in to change notification settings - Fork 1
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 qemu test #827
Add qemu test #827
Conversation
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.
Looks good to me.
src/cli/cmds/serial.toit
Outdated
@@ -200,6 +209,16 @@ flash parsed/cli.Parsed config/Config cache/Cache ui/Ui: | |||
if reference.id: info += "." | |||
else: info += " ($pod.id)." | |||
ui.info info | |||
else if qemu-image: | |||
if pod.chip != "esp32" and not pod.chip.starts-with "esp32-": | |||
ui.abort "Cannot write to Qemu image file for chip '$pod.chip'." |
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.
ui.abort "Cannot write to Qemu image file for chip '$pod.chip'." | |
ui.abort "Cannot write to QEMU image file for chip '$pod.chip'." |
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.
You decide if you want to stick with Qemu over QEMU, because it looks like you use Qemu fairly consistenly even though it is called QEMU :)
src/cli/cmds/serial.toit
Outdated
@@ -93,6 +97,10 @@ create-serial-commands config/Config cache/Cache ui/Ui -> List: | |||
--short-name="i" | |||
--short-help="The identity file to use." | |||
--required, | |||
cli.Option "qemu-image" | |||
--type="file" | |||
--short-help="Write to an Qemu image file instead of flashing." |
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.
--short-help="Write to an Qemu image file instead of flashing." | |
--short-help="Write to an QEMU image file instead of flashing." |
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.
done.
tests/qemu-hello-test.toit
Outdated
|
||
HELLO-WORLD-CODE ::= """ | ||
main: print "hello world" | ||
""" |
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.
I would probably dedent this.
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.
done.
tests/qemu-hello-test.toit
Outdated
provider := esp32.EthernetServiceProvider.mac-openeth | ||
--phy-chip=esp32.PHY-CHIP-DP83848 | ||
provider.install | ||
""" |
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.
I would probably dedent this.
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.
done.
tests/qemu-hello-test.toit
Outdated
write-blob-to-file eth-provider-path ETHERNET-PROVIDER-CODE | ||
|
||
print "Creating qemu firmware." | ||
// Create a firmware. |
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.
Not sure the comment helps given the printing above.
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.
done.
tests/qemu-hello-test.toit
Outdated
eth-provider-path := "$fleet-dir/eth-provider.toit" | ||
write-blob-to-file eth-provider-path ETHERNET-PROVIDER-CODE | ||
|
||
print "Creating qemu firmware." |
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.
print "Creating qemu firmware." | |
print "Creating Qemu firmware." |
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.
done.
tests/utils.toit
Outdated
@@ -165,6 +169,7 @@ class TestCli: | |||
cli.main args --config=config --cache=cache --ui=ui | |||
finally: | is-exception _ | | |||
if is-exception: | |||
print "args: $args" |
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.
Drop the debug printing again?
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.
I think it's actually quite helpful, and it only triggers if things fail.
changed it to be "nicer":
"Execution of '$args' failed unexpectedly."
done.
No description provided.