Fix tests and update translations

This commit is contained in:
Scott Shawcroft 2023-10-20 16:56:30 -07:00
parent fa68428611
commit 508b064ebb
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
6 changed files with 82 additions and 55 deletions

View File

@ -145,6 +145,11 @@ STATIC const mp_rom_map_elem_t task_queue_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_push), MP_ROM_PTR(&task_queue_push_obj) }, { MP_ROM_QSTR(MP_QSTR_push), MP_ROM_PTR(&task_queue_push_obj) },
{ MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&task_queue_pop_obj) }, { MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&task_queue_pop_obj) },
{ MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&task_queue_remove_obj) }, { MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&task_queue_remove_obj) },
// CIRCUITPY-CHANGE: Remove these in CircuitPython 10.0.0
{ MP_ROM_QSTR(MP_QSTR_push_head), MP_ROM_PTR(&task_queue_push_obj) },
{ MP_ROM_QSTR(MP_QSTR_push_sorted), MP_ROM_PTR(&task_queue_push_obj) },
{ MP_ROM_QSTR(MP_QSTR_pop_head), MP_ROM_PTR(&task_queue_pop_obj) },
}; };
STATIC MP_DEFINE_CONST_DICT(task_queue_locals_dict, task_queue_locals_dict_table); STATIC MP_DEFINE_CONST_DICT(task_queue_locals_dict, task_queue_locals_dict_table);

View File

@ -437,7 +437,7 @@ STATIC mp_obj_t mod_json_loads(mp_obj_t obj) {
mp_get_buffer_raise(obj, &bufinfo, MP_BUFFER_READ); mp_get_buffer_raise(obj, &bufinfo, MP_BUFFER_READ);
vstr_t vstr = {bufinfo.len, bufinfo.len, (char *)bufinfo.buf, true}; vstr_t vstr = {bufinfo.len, bufinfo.len, (char *)bufinfo.buf, true};
mp_obj_stringio_t sio = {{&mp_type_stringio}, &vstr, 0, MP_OBJ_NULL}; mp_obj_stringio_t sio = {{&mp_type_stringio}, &vstr, 0, MP_OBJ_NULL};
return mod_json_load(MP_OBJ_FROM_PTR(&sio)); return _mod_json_load(MP_OBJ_FROM_PTR(&sio), false);
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_json_loads_obj, mod_json_loads); STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_json_loads_obj, mod_json_loads);

View File

@ -395,15 +395,7 @@ msgid "'await' outside function"
msgstr "" msgstr ""
#: py/compile.c #: py/compile.c
msgid "'await', 'async for' or 'async with' outside async function" msgid "'break'/'continue' outside loop"
msgstr ""
#: py/compile.c
msgid "'break' outside loop"
msgstr ""
#: py/compile.c
msgid "'continue' outside loop"
msgstr "" msgstr ""
#: py/compile.c #: py/compile.c
@ -422,10 +414,6 @@ msgstr ""
msgid "'return' outside function" msgid "'return' outside function"
msgstr "" msgstr ""
#: py/compile.c
msgid "'yield from' inside async function"
msgstr ""
#: py/compile.c #: py/compile.c
msgid "'yield' outside function" msgid "'yield' outside function"
msgstr "" msgstr ""
@ -965,7 +953,7 @@ msgstr ""
msgid "EXTINT channel already in use" msgid "EXTINT channel already in use"
msgstr "" msgstr ""
#: extmod/modure.c #: extmod/modre.c
msgid "Error in regex" msgid "Error in regex"
msgstr "" msgstr ""
@ -1045,7 +1033,7 @@ msgstr ""
msgid "Failed to write internal flash." msgid "Failed to write internal flash."
msgstr "" msgstr ""
#: py/moduerrno.c #: py/moderrno.c
msgid "File exists" msgid "File exists"
msgstr "" msgstr ""
@ -1180,7 +1168,7 @@ msgstr ""
msgid "Input taking too long" msgid "Input taking too long"
msgstr "" msgstr ""
#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c #: ports/espressif/common-hal/neopixel_write/__init__.c py/moderrno.c
msgid "Input/output error" msgid "Input/output error"
msgstr "" msgstr ""
@ -1259,7 +1247,7 @@ msgstr ""
msgid "Invalid MAC address" msgid "Invalid MAC address"
msgstr "" msgstr ""
#: ports/espressif/common-hal/espidf/__init__.c py/moduerrno.c #: ports/espressif/common-hal/espidf/__init__.c py/moderrno.c
msgid "Invalid argument" msgid "Invalid argument"
msgstr "" msgstr ""
@ -1525,15 +1513,15 @@ msgstr ""
msgid "No pulldown on pin; 1Mohm recommended" msgid "No pulldown on pin; 1Mohm recommended"
msgstr "" msgstr ""
#: py/moduerrno.c #: py/moderrno.c
msgid "No space left on device" msgid "No space left on device"
msgstr "" msgstr ""
#: py/moduerrno.c #: py/moderrno.c
msgid "No such device" msgid "No such device"
msgstr "" msgstr ""
#: py/moduerrno.c #: py/moderrno.c
msgid "No such file/directory" msgid "No such file/directory"
msgstr "" msgstr ""
@ -1654,7 +1642,7 @@ msgstr ""
msgid "Only one color can be transparent at a time" msgid "Only one color can be transparent at a time"
msgstr "" msgstr ""
#: py/moduerrno.c #: py/moderrno.c
msgid "Operation not permitted" msgid "Operation not permitted"
msgstr "" msgstr ""
@ -1708,7 +1696,7 @@ msgstr ""
msgid "Peripheral in use" msgid "Peripheral in use"
msgstr "" msgstr ""
#: py/moduerrno.c #: py/moderrno.c
msgid "Permission denied" msgid "Permission denied"
msgstr "" msgstr ""
@ -1842,7 +1830,7 @@ msgstr ""
msgid "Read-only" msgid "Read-only"
msgstr "" msgstr ""
#: extmod/vfs_fat.c py/moduerrno.c #: extmod/vfs_fat.c py/moderrno.c
msgid "Read-only filesystem" msgid "Read-only filesystem"
msgstr "" msgstr ""
@ -2403,7 +2391,7 @@ msgstr ""
msgid "__new__ arg must be a user-type" msgid "__new__ arg must be a user-type"
msgstr "" msgstr ""
#: extmod/modubinascii.c extmod/moduhashlib.c py/objarray.c #: extmod/modbinascii.c extmod/modhashlib.c py/objarray.c
msgid "a bytes-like object is required" msgid "a bytes-like object is required"
msgstr "" msgstr ""
@ -2477,6 +2465,10 @@ msgstr ""
msgid "asm overflow" msgid "asm overflow"
msgstr "" msgstr ""
#: py/compile.c
msgid "async for/with outside async function"
msgstr ""
#: extmod/ulab/code/numpy/numerical.c #: extmod/ulab/code/numpy/numerical.c
msgid "attempt to get (arg)min/(arg)max of empty sequence" msgid "attempt to get (arg)min/(arg)max of empty sequence"
msgstr "" msgstr ""
@ -2529,7 +2521,7 @@ msgstr ""
msgid "bitmap sizes must match" msgid "bitmap sizes must match"
msgstr "" msgstr ""
#: extmod/modurandom.c #: extmod/modrandom.c
msgid "bits must be 32 or less" msgid "bits must be 32 or less"
msgstr "" msgstr ""
@ -2610,11 +2602,11 @@ msgstr ""
msgid "can't assign to expression" msgid "can't assign to expression"
msgstr "" msgstr ""
#: extmod/moduasyncio.c #: extmod/modasyncio.c
msgid "can't cancel self" msgid "can't cancel self"
msgstr "" msgstr ""
#: py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c #: shared-module/adafruit_pixelbuf/PixelBuf.c
msgid "can't convert %q to %q" msgid "can't convert %q to %q"
msgstr "" msgstr ""
@ -2628,6 +2620,11 @@ msgstr ""
msgid "can't convert %s to float" msgid "can't convert %s to float"
msgstr "" msgstr ""
#: py/runtime.c
#, c-format
msgid "can't convert %s to int"
msgstr ""
#: py/objstr.c #: py/objstr.c
msgid "can't convert '%q' object to %q implicitly" msgid "can't convert '%q' object to %q implicitly"
msgstr "" msgstr ""
@ -2738,7 +2735,7 @@ msgstr ""
msgid "can't unambiguously get sizeof scalar" msgid "can't unambiguously get sizeof scalar"
msgstr "" msgstr ""
#: extmod/moduasyncio.c #: extmod/modasyncio.c
msgid "can't wait" msgid "can't wait"
msgstr "" msgstr ""
@ -2830,7 +2827,7 @@ msgstr ""
msgid "complex values not supported" msgid "complex values not supported"
msgstr "" msgstr ""
#: extmod/moduzlib.c #: extmod/modzlib.c
msgid "compression header" msgid "compression header"
msgstr "" msgstr ""
@ -2944,7 +2941,7 @@ msgstr ""
msgid "empty file" msgid "empty file"
msgstr "" msgstr ""
#: extmod/moduasyncio.c extmod/moduheapq.c #: extmod/modasyncio.c extmod/modheapq.c
msgid "empty heap" msgid "empty heap"
msgstr "" msgstr ""
@ -3073,6 +3070,10 @@ msgstr ""
msgid "font must be 2048 bytes long" msgid "font must be 2048 bytes long"
msgstr "" msgstr ""
#: extmod/moddeflate.c
msgid "format"
msgstr ""
#: py/objstr.c #: py/objstr.c
msgid "format requires a dict" msgid "format requires a dict"
msgstr "" msgstr ""
@ -3149,11 +3150,11 @@ msgstr ""
msgid "graphic must be 2048 bytes long" msgid "graphic must be 2048 bytes long"
msgstr "" msgstr ""
#: extmod/moduhashlib.c #: extmod/modhashlib.c
msgid "hash is final" msgid "hash is final"
msgstr "" msgstr ""
#: extmod/moduheapq.c #: extmod/modheapq.c
msgid "heap must be a list" msgid "heap must be a list"
msgstr "" msgstr ""
@ -3185,7 +3186,7 @@ msgstr ""
msgid "incomplete format key" msgid "incomplete format key"
msgstr "" msgstr ""
#: extmod/modubinascii.c #: extmod/modbinascii.c
msgid "incorrect padding" msgid "incorrect padding"
msgstr "" msgstr ""
@ -3314,7 +3315,7 @@ msgid "interval must be in range %s-%s"
msgstr "" msgstr ""
#: py/compile.c #: py/compile.c
msgid "invalid architecture" msgid "invalid arch"
msgstr "" msgstr ""
#: shared-bindings/bitmaptools/__init__.c #: shared-bindings/bitmaptools/__init__.c
@ -3503,6 +3504,10 @@ msgstr ""
msgid "memoryview: length is not a multiple of itemsize" msgid "memoryview: length is not a multiple of itemsize"
msgstr "" msgstr ""
#: extmod/modtime.c
msgid "mktime needs a tuple of length 8 or 9"
msgstr ""
#: extmod/ulab/code/numpy/linalg/linalg.c #: extmod/ulab/code/numpy/linalg/linalg.c
msgid "mode must be complete, or reduced" msgid "mode must be complete, or reduced"
msgstr "" msgstr ""
@ -3600,7 +3605,7 @@ msgstr ""
msgid "no default packer" msgid "no default packer"
msgstr "" msgstr ""
#: extmod/modurandom.c #: extmod/modrandom.c
msgid "no default seed" msgid "no default seed"
msgstr "" msgstr ""
@ -4027,7 +4032,7 @@ msgstr ""
msgid "source_bitmap must have value_count of 8" msgid "source_bitmap must have value_count of 8"
msgstr "" msgstr ""
#: extmod/modure.c #: extmod/modre.c
msgid "splitting with sub-captures" msgid "splitting with sub-captures"
msgstr "" msgstr ""
@ -4076,7 +4081,7 @@ msgstr ""
msgid "super() can't find self" msgid "super() can't find self"
msgstr "" msgstr ""
#: extmod/modujson.c #: extmod/modjson.c
msgid "syntax error in JSON" msgid "syntax error in JSON"
msgstr "" msgstr ""
@ -4084,7 +4089,7 @@ msgstr ""
msgid "syntax error in uctypes descriptor" msgid "syntax error in uctypes descriptor"
msgstr "" msgstr ""
#: extmod/utime_mphal.c #: extmod/modtime.c
msgid "ticks interval overflow" msgid "ticks interval overflow"
msgstr "" msgstr ""
@ -4262,7 +4267,7 @@ msgid "unsupported format character '%c' (0x%x) at index %d"
msgstr "" msgstr ""
#: py/runtime.c #: py/runtime.c
msgid "unsupported type for %q: '%q'" msgid "unsupported type for %q: '%s'"
msgstr "" msgstr ""
#: py/runtime.c #: py/runtime.c
@ -4290,6 +4295,10 @@ msgstr ""
msgid "value out of range of target" msgid "value out of range of target"
msgstr "" msgstr ""
#: extmod/moddeflate.c
msgid "wbits"
msgstr ""
#: shared-bindings/is31fl3741/FrameBuffer.c #: shared-bindings/is31fl3741/FrameBuffer.c
msgid "width must be greater than zero" msgid "width must be greater than zero"
msgstr "" msgstr ""

View File

@ -40,4 +40,4 @@ async def main():
print("finish") print("finish")
uasyncio.run(main()) asyncio.run(main())

View File

@ -715,13 +715,18 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
output_expected = f.read() output_expected = f.read()
else: else:
# CIRCUITPY-CHANGE: set language & make sure testlib is available for `skip_ok`. # CIRCUITPY-CHANGE: set language & make sure testlib is available for `skip_ok`.
e = {"PYTHONPATH": "testlib", "PATH": os.environ["PATH"], "LANG": "en_US.UTF-8"} e = {
"PYTHONPATH": base_path("testlib"),
"PATH": os.environ["PATH"],
"LANG": "en_US.UTF-8",
}
# run CPython to work out expected output # run CPython to work out expected output
try: try:
output_expected = subprocess.check_output( output_expected = subprocess.check_output(
CPYTHON3_CMD + [os.path.abspath(test_file)], CPYTHON3_CMD + [os.path.abspath(test_file)],
cwd=os.path.dirname(test_file), cwd=os.path.dirname(test_file),
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
env=e,
) )
if args.write_exp: if args.write_exp:
with open(test_file_expected, "wb") as f: with open(test_file_expected, "wb") as f:
@ -1022,8 +1027,16 @@ the last matching regex is used:
tests = args.files tests = args.files
if not args.keep_path: if not args.keep_path:
# clear search path to make sure tests use only builtin modules and those in extmod # clear search path to make sure tests use only builtin modules and those that can be frozen
os.environ["MICROPYPATH"] = ".frozen" + os.pathsep + base_path("../extmod") # CIRCUITPY-CHANGE: Add testlib for skip_if and our async stuff.
os.environ["MICROPYPATH"] = os.pathsep.join(
[
".frozen",
base_path("testlib"),
base_path("../frozen/Adafruit_CircuitPython_asyncio"),
base_path("../frozen/Adafruit_CircuitPython_Ticks"),
]
)
try: try:
os.makedirs(args.result_dir, exist_ok=True) os.makedirs(args.result_dir, exist_ok=True)

View File

@ -15,12 +15,12 @@ false true
abc abc
% %
# GC # GC
0 0x0
0 0x0
# GC part 2 # GC part 2
pass pass
# tracked allocation # tracked allocation
m_tracked_head = 0 m_tracked_head = 0x0
0 1 0 1
1 1 1 1
2 1 2 1
@ -37,7 +37,7 @@ m_tracked_head = 0
5 1 5 1
6 1 6 1
7 1 7 1
m_tracked_head = 0 m_tracked_head = 0x0
# vstr # vstr
tests tests
sts sts
@ -48,18 +48,18 @@ RuntimeError:
RuntimeError: RuntimeError:
# repl # repl
ame__ ame__
mport port
builtins micropython __future__ _asyncio builtins micropython __future__ _asyncio
_thread aesio array audiocore _thread aesio array audiocore
audiomixer binascii bitmaptools cexample audiomixer binascii bitmaptools cexample
cmath collections cppexample displayio cmath collections cppexample displayio
errno gc hashlib heapq errno example_package gc
io json math os hashlib heapq io json
platform qrio rainbowio random math os platform qrio
re select struct synthio rainbowio random re select
sys time traceback uctypes struct synthio sys time
ulab zlib traceback uctypes ulab zlib
me me
rainbowio random rainbowio random