diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-02-28 00:31:18 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-02-28 00:31:18 +0200 |
commit | 562fa575a67a6f2e84fdeb5303c1ac42934015ce (patch) | |
tree | 9e41943cfe3640f7e7b134ef75745cae443d8a80 /qemu-arm/test_main.c | |
parent | 992284be39857f61c9b408ed4a6dad4ca5bfe7f9 (diff) | |
download | micropython-562fa575a67a6f2e84fdeb5303c1ac42934015ce.tar.gz micropython-562fa575a67a6f2e84fdeb5303c1ac42934015ce.zip |
qemu-arm: Handle sys.exit() to allow skip tests in testsuite.
Diffstat (limited to 'qemu-arm/test_main.c')
-rw-r--r-- | qemu-arm/test_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qemu-arm/test_main.c b/qemu-arm/test_main.c index d6fbfded6e..a48bcd3221 100644 --- a/qemu-arm/test_main.c +++ b/qemu-arm/test_main.c @@ -31,7 +31,15 @@ inline void do_str(const char *src) { mp_call_function_0(module_fun); nlr_pop(); } 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"); } end: |