-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
tests: add support for native-specific .exp test output files #17882
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
tests: add support for native-specific .exp test output files #17882
Conversation
Minor tidbit: To me the naming |
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.
This LGTM! Although also have a slight preference for filename.native.exp
rather than the other way around.
ec74903
to
cdaca1e
Compare
Thanks for the reviews. I've now changed the file pattern to |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17882 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22295 22295
=======================================
Hits 21936 21936
Misses 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There are currently a few tests that are excluded when using the native emitter because they test printing of exception tracebacks, which includes line numbers. And the native emitter doesn't store line numbers, so gets these tests wrong. But we'd still like to run these tests using the native emitter, because they test useful things even if the line number info is not in the traceback (eg that threads which crash print out their exception). This commit adds support for native-specific .exp files, which are of the form `<test>.py.native.exp`. If such an .exp file exists then it take precedence over any normal `<test>.py.exp` file. (Actually, the implementation here is general enough that it also supports `<test>.py.bytecode.exp` as well, if bytecode ever needs a specific exp file.) Signed-off-by: Damien George <damien@micropython.org>
This allows the test to run with the native emitter. The test semantics remain the same. Signed-off-by: Damien George <damien@micropython.org>
So that the test can run the same on all targets when used with the native emitter. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
cdaca1e
to
a279c64
Compare
Summary
There are currently a few tests that are excluded when using the native emitter because they test printing of exception tracebacks, which includes line numbers. And the native emitter doesn't store line numbers, so gets these tests wrong.
But we'd still like to run these tests using the native emitter, because they test useful things even if the line number info is not in the traceback (eg that threads which crash print out their exception).
This PR adds support for native-specific .exp files, which are of the form
<test>.py.exp.native
. If such an .exp file exists then it take precedence over any normal<test>.py.exp
file. (Actually, the implementation is general enough that it also supports<test>py.exp.bytecode
as well, if bytecode ever needs a specific exp file.)In this PR:
run-tests.py
to look for<test>.py.exp.native
files (a very simple change)run-tests.py
Testing
Tested locally on PYBD_SF6, RPI_PICO2_W, ESP32 and unix port. There were no regressions, and the new tests (now no longer excluded) pass with the native emitter.
Will also be tested by CI.
Trade-offs and Alternatives