summaryrefslogtreecommitdiff
path: root/tests/run-tests.py
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-04-19 12:17:11 +1000
committerDamien George <damien@micropython.org>2024-04-24 16:24:00 +1000
commit8a3546b3bd71dbc6d79900afbe58767e09b82c3e (patch)
treeb0dda67172d16b89ed37b13d929d909c6ed7e5c5 /tests/run-tests.py
parent84d6f8e8cb993e82f03e209ffd49d5c44fc780e0 (diff)
webassembly: Add JavaScript-based asyncio support.
This commit adds a significant portion of the existing MicroPython asyncio module to the webassembly port, using parts of the existing asyncio code and some custom JavaScript parts. The key difference to the standard asyncio is that this version uses the JavaScript runtime to do the actual scheduling and waiting on events, eg Promise fulfillment, timeouts, fetching URLs. This implementation does not include asyncio.run(). Instead one just uses asyncio.create_task(..) to start tasks and then returns to the JavaScript. Then JavaScript will run the tasks. The implementation here tries to reuse as much existing asyncio code as possible, and gets all the semantics correct for things like cancellation and asyncio.wait_for. An alternative approach would reimplement Task, Event, etc using JavaScript Promise's. That approach is very difficult to get right when trying to implement cancellation (because it's not possible to cancel a JavaScript Promise). Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/run-tests.py')
-rwxr-xr-xtests/run-tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 4f55cdd39..8acdcd2b3 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -681,6 +681,17 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
elif args.target == "webassembly":
skip_tests.add("basics/string_format_modulo.py") # can't print nulls to stdout
skip_tests.add("basics/string_strip.py") # can't print nulls to stdout
+ skip_tests.add("extmod/asyncio_basic2.py")
+ skip_tests.add("extmod/asyncio_cancel_self.py")
+ skip_tests.add("extmod/asyncio_current_task.py")
+ skip_tests.add("extmod/asyncio_exception.py")
+ skip_tests.add("extmod/asyncio_gather_finished_early.py")
+ skip_tests.add("extmod/asyncio_get_event_loop.py")
+ skip_tests.add("extmod/asyncio_heaplock.py")
+ skip_tests.add("extmod/asyncio_loop_stop.py")
+ skip_tests.add("extmod/asyncio_new_event_loop.py")
+ skip_tests.add("extmod/asyncio_threadsafeflag.py")
+ skip_tests.add("extmod/asyncio_wait_for_fwd.py")
skip_tests.add("extmod/binascii_a2b_base64.py")
skip_tests.add("extmod/re_stack_overflow.py")
skip_tests.add("extmod/time_res.py")