Skip to content
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

Merged
merged 3 commits into from
Sep 25, 2023
Merged

Add qemu test #827

merged 3 commits into from
Sep 25, 2023

Conversation

floitsch
Copy link
Member

No description provided.

@floitsch floitsch requested a review from kasperl September 21, 2023 17:18
Copy link
Contributor

@kasperl kasperl left a 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.

@@ -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'."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ui.abort "Cannot write to Qemu image file for chip '$pod.chip'."
ui.abort "Cannot write to QEMU image file for chip '$pod.chip'."

Copy link
Contributor

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 :)

@@ -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."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
--short-help="Write to an Qemu image file instead of flashing."
--short-help="Write to an QEMU image file instead of flashing."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


HELLO-WORLD-CODE ::= """
main: print "hello world"
"""
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

provider := esp32.EthernetServiceProvider.mac-openeth
--phy-chip=esp32.PHY-CHIP-DP83848
provider.install
"""
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

write-blob-to-file eth-provider-path ETHERNET-PROVIDER-CODE

print "Creating qemu firmware."
// Create a firmware.
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

eth-provider-path := "$fleet-dir/eth-provider.toit"
write-blob-to-file eth-provider-path ETHERNET-PROVIDER-CODE

print "Creating qemu firmware."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print "Creating qemu firmware."
print "Creating Qemu firmware."

Copy link
Member Author

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"
Copy link
Contributor

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?

Copy link
Member Author

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.

@floitsch floitsch enabled auto-merge (squash) September 25, 2023 08:59
@floitsch floitsch merged commit 99852b0 into main Sep 25, 2023
@floitsch floitsch deleted the floitsch/qemu branch September 25, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants