diff --git a/tests/feature_check/const.py b/tests/feature_check/const.py new file mode 100644 index 0000000000..db32e8c69b --- /dev/null +++ b/tests/feature_check/const.py @@ -0,0 +1 @@ +x = const(1) diff --git a/tests/feature_check/const.py.exp b/tests/feature_check/const.py.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/run-tests b/tests/run-tests index 43db15097e..773f3dc396 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -201,6 +201,7 @@ def run_tests(pyb, tests, args): skip_int_big = False skip_set_type = False skip_async = False + skip_const = False # Check if micropython.native is supported, and skip such tests if it's not native = run_micropython(pyb, args, 'feature_check/native_check.py') @@ -222,6 +223,11 @@ def run_tests(pyb, tests, args): if native == b'CRASH': skip_async = True + # Check if const keyword (MicroPython extension) is supported, and skip such tests if it's not + native = run_micropython(pyb, args, 'feature_check/const.py') + if native == b'CRASH': + skip_const = True + # Check if emacs repl is supported, and skip such tests if it's not t = run_micropython(pyb, args, 'feature_check/repl_emacs_check.py') if not 'True' in str(t, 'ascii'): @@ -330,6 +336,7 @@ def run_tests(pyb, tests, args): is_int_big = test_name.startswith("int_big") or test_name.endswith("_intbig") is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset") is_async = test_name.startswith("async_") + is_const = test_name.startswith("const") skip_it = test_file in skip_tests skip_it |= skip_native and is_native @@ -337,6 +344,7 @@ def run_tests(pyb, tests, args): skip_it |= skip_int_big and is_int_big skip_it |= skip_set_type and is_set_type skip_it |= skip_async and is_async + skip_it |= skip_const and is_const if skip_it: print("skip ", test_file)