Skip to content
Snippets Groups Projects
Commit 562fa575 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

qemu-arm: Handle sys.exit() to allow skip tests in testsuite.

parent 992284be
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define MICROPY_PY_BUILTINS_FROZENSET (1) #define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1) #define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
#define MICROPY_PY_IO (0) #define MICROPY_PY_IO (0)
#define MICROPY_PY_SYS_EXIT (1)
// type definitions for the specific machine // type definitions for the specific machine
......
...@@ -31,7 +31,15 @@ inline void do_str(const char *src) { ...@@ -31,7 +31,15 @@ inline void do_str(const char *src) {
mp_call_function_0(module_fun); mp_call_function_0(module_fun);
nlr_pop(); nlr_pop();
} else { } else {
mp_obj_print_exception(printf_wrapper, NULL, (mp_obj_t)nlr.ret_val); mp_obj_t exc = (mp_obj_t)nlr.ret_val;
if (mp_obj_is_subclass_fast(mp_obj_get_type(exc), &mp_type_SystemExit)) {
// Assume that sys.exit() is called to skip the test.
// TODO: That can be always true, we should set up convention to
// use specific exit code as skip indicator.
tinytest_set_test_skipped_();
return;
}
mp_obj_print_exception(printf_wrapper, NULL, exc);
tt_abort_msg("Uncaught exception"); tt_abort_msg("Uncaught exception");
} }
end: end:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment