tests: use stdin/stdout when compiling using mpy-cross, instead of temporary files#19216
Open
dpgeorge wants to merge 3 commits into
Open
tests: use stdin/stdout when compiling using mpy-cross, instead of temporary files#19216dpgeorge wants to merge 3 commits into
dpgeorge wants to merge 3 commits into
Conversation
Otherwise running performance tests with `--via-mpy` does not work. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
This change pipes data into and out of mpy-cross using stdin/stdout, instead of creating two temporary files. That should be more efficient, reducing load on the filesystem. As part of this change, pass through the correct .py filename to mpy-cross' "-s" argument, to make error messages a little easier to understand. Signed-off-by: Damien George <damien@micropython.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19216 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 176 176
Lines 22845 22845
=======================================
Hits 22497 22497
Misses 348 348 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This change pipes data into and out of mpy-cross using stdin/stdout, instead of creating two temporary files. That should be more efficient, reducing load on the filesystem.
As part of this change, pass through the correct .py filename to mpy-cross' "-s" argument, to make error messages a little easier to understand.
Also fix a related bug with missing prologue in
run-perfbench.pythat was found when testing this change.Testing
Ran on a bare-metal target, using
--via-mpyand--via-mpy --emit native. The tests still run.Also tested the cases of mpy-cross crashing due to invalid arguments passed into it, and due to a syntax error in a .py file.
Generative AI
I did not use generative AI tools when creating this PR.