diff options
| author | Andrew Leech <andrew.leech@planetinnovation.com.au> | 2025-05-26 19:28:02 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-11-22 00:06:58 +1100 |
| commit | 7b3a0fc6b7fe935be008d2518eb480b75a8809d1 (patch) | |
| tree | a72cb0fadb897ca5733e6e712f838b934cbdf04f /tests/cmdline/cmd_compile_only_error.py | |
| parent | 3b2b8dd53826ef3b7ef755013e1ecdccd368cb8c (diff) | |
shared/runtime/pyexec: Provide support for compile-only mode.
When `MICROPY_PYEXEC_COMPILE_ONLY` is enabled and the global
`mp_compile_only` is True, code is compiled but not executed.
Also add comprehensive tests for compile-only functionality covering both
successful compilation and syntax error detection.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Diffstat (limited to 'tests/cmdline/cmd_compile_only_error.py')
| -rw-r--r-- | tests/cmdline/cmd_compile_only_error.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/cmdline/cmd_compile_only_error.py b/tests/cmdline/cmd_compile_only_error.py new file mode 100644 index 000000000..326937a5c --- /dev/null +++ b/tests/cmdline/cmd_compile_only_error.py @@ -0,0 +1,6 @@ +# cmdline: -X compile-only +# test compile-only with syntax error +print("This should not be printed") +def broken_syntax( + # Missing closing parenthesis + return "error" |
