diff --git a/qemu-arm/mpconfigport.h b/qemu-arm/mpconfigport.h
index f9e12586190b3aa2ae5910a4ceda2502f13de473..a9f98e5ce2875221d6a168156c426e23b476cf8f 100644
--- a/qemu-arm/mpconfigport.h
+++ b/qemu-arm/mpconfigport.h
@@ -18,6 +18,7 @@
 #define MICROPY_PY_BUILTINS_FROZENSET (1)
 #define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
 #define MICROPY_PY_IO               (0)
+#define MICROPY_PY_SYS_EXIT         (1)
 
 // type definitions for the specific machine
 
diff --git a/qemu-arm/test_main.c b/qemu-arm/test_main.c
index d6fbfded6ea4955e39b04ec1f40e724a75406ff0..a48bcd32215010405a78d496529cc4ad4b236abe 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: