Test REPR_B & fix test failures (w/o uctypes)#18109
Test REPR_B & fix test failures (w/o uctypes)#18109jepler wants to merge 6 commits intomicropython:masterfrom
Conversation
tools/ci.sh
Outdated
| (-h|-?|--help) | ||
| _ci_help | ||
| ;; | ||
| (--jeff) |
There was a problem hiding this comment.
Jeff gets own special option. 😆
There was a problem hiding this comment.
haha that wasn't supposed to be there. 🤣
There was a problem hiding this comment.
You've been working very hard lately. I think you deserve it.
|
Code size report: |
b40a526 to
2d86f52
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18109 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22287 22288 +1
=======================================
+ Hits 21928 21929 +1
Misses 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2d86f52 to
4e1408b
Compare
| try: | ||
| k = k + 1 | ||
| except MemoryError: | ||
| print("SKIP") |
There was a problem hiding this comment.
Instead of SKIP'ing and essentially duplicating this test below for REPR_B, how about using this bit of code here as a feature detection for the integer values to iterate over.
Eg:
limit_value = 1 << 29
micropython.heap_lock()
try:
k = limit_value + 1
except MemoryError:
# REPR B, use a smaller limit value
limit_value = 1 << 28
micropython.heap_unlock()
for d in (0, 27, limit_value, -1861, -limit_value):
...Oh... I guess that makes the .exp file different... which is probably too difficult to work around. In that case I guess it's OK to have separate test files.
abffd43 to
62381ff
Compare
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Different results are needed for different integer sizes. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
The check for 'fits in a small int' is specific to the 31-bit int of other OBJ_REPRs. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
This showed up some interesting errors (hopefully all fixed now). Signed-off-by: Jeff Epler <jepler@unpythonic.net>
62381ff to
9e09eb1
Compare
dpgeorge
left a comment
There was a problem hiding this comment.
This looks good now, a nice clean set of changes. Thanks!
Summary
For m68k-micropython I'm interested in REPR_B. However, CI doesn't check any REPR_B builds, so of course there were test failures.
This patch series adds a 32-bit REPR_B build (i686 Linux) and fixes the test failures that arose.
This is an alternative to the original #17688 that doesn't make an incompatible change to the uctypes constants, which turn out to need to be stable.
It punts on several limitations, filed as issues:
Testing
This adds a new build and associated tests to CI.
Trade-offs and Alternatives
While it was the uctypes problem that made me look into this in the first place, it turns out to be hard to fix; I'll probably just carry the incompatible fix (modifying the uctypes constant values) in m68k-micropython.