circuitpython/tests/misc
Damien George 229104558f tests/run-tests.py: Automatically skip tests that are too large.
Some tests are just too big for targets that don't have much heap memory,
eg `tests/extmod/vfs_rom.py`.  Other tests are too large because the target
doesn't have enough IRAM for native code, eg esp8266 running
`tests/micropython/viper_args.py`.

Previously, such tests were explicitly skipped on targets known to have
little memory, eg esp8266.  But this doesn't scale to multiple targets, nor
to more and more tests which are too large.

This commit addresses that by adding logic to the test runner so it can
automatically skip tests when they don't fit in the target's memory.  It
does this by prepending a `print('START TEST')` to every test, and if a
`MemoryError` occurs before that line is printed then the test was too big.
This works for standard tests, tests that go via .mpy files, and tests that
run in native emitter mode via .mpy files.

For tests that are too big, it prints `lrge  <test name>` on the output,
and at the end prints them on a separate line of skipped tests so they can
be distinguished.  They are also distinguished in the `_result.json` file
as a skipped test with reason "too large".

Signed-off-by: Damien George <damien@micropython.org>
2025-06-05 15:15:31 +10:00
..
sys_settrace_subdir py/profile: Remove the requirement to disable MICROPY_COMP_CONST. 2023-08-30 10:58:04 +10:00
cexample_class.py examples/usercmodule/cexample: Add more advanced native class. 2024-07-25 11:57:13 +10:00
cexample_class.py.exp examples/usercmodule/cexample: Add more advanced native class. 2024-07-25 11:57:13 +10:00
cexample_module.py examples/usercmodule/cexample: Add more advanced native class. 2024-07-25 11:57:13 +10:00
cexample_module.py.exp tests/misc/cexample_module: Test class presence. 2022-11-25 08:13:15 +01:00
cexample_subclass.py py/objtype: Avoid crash on calling members of uninitialized native type. 2024-07-25 12:01:43 +10:00
cexample_subclass.py.exp py/objtype: Avoid crash on calling members of uninitialized native type. 2024-07-25 12:01:43 +10:00
features.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
non_compliant.py py/objstr: Support tuples and start/end args in startswith and endswith. 2025-03-02 22:15:31 +11:00
non_compliant.py.exp py/objstr: Support tuples and start/end args in startswith and endswith. 2025-03-02 22:15:31 +11:00
non_compliant_lexer.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
non_compliant_lexer.py.exp py/lexer: Raise NotImplError for unicode name escape, instead of assert. 2015-09-07 17:08:49 +01:00
print_exception.py tests/run-tests.py: Automatically skip tests that are too large. 2025-06-05 15:15:31 +10:00
rge_sm.py all: Update Python formatting to ruff-format. 2023-11-03 13:30:41 +11:00
sys_atexit.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
sys_atexit.py.exp tests/misc/sys_atexit: Add test for new sys.atexit feature. 2019-08-15 17:31:04 +10:00
sys_exc_info.py tests: Replace umodule with module everywhere. 2023-06-08 17:54:24 +10:00
sys_settrace_features.py tests/misc/sys_settrace_features.py: Add note about CPython 3.12 issue. 2024-11-28 23:11:36 +11:00
sys_settrace_generator.py top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
sys_settrace_generator.py.exp top: Update Python formatting to black "2023 stable style". 2023-02-02 12:51:03 +11:00
sys_settrace_loop.py tests/misc/sys_settrace: Make test output independent of invoked path. 2020-12-18 13:56:45 +11:00
sys_settrace_loop.py.exp tests/misc/sys_settrace: Make test output independent of invoked path. 2020-12-18 13:56:45 +11:00