run-tests: Add feature check for "const" keyword and skip related tests.

This commit is contained in:
Paul Sokolovsky 2017-04-02 22:51:31 +03:00
parent b9e9cfcfc1
commit b099aeb3ca
3 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1 @@
x = const(1)

View File

View File

@ -201,6 +201,7 @@ def run_tests(pyb, tests, args):
skip_int_big = False skip_int_big = False
skip_set_type = False skip_set_type = False
skip_async = False skip_async = False
skip_const = False
# Check if micropython.native is supported, and skip such tests if it's not # Check if micropython.native is supported, and skip such tests if it's not
native = run_micropython(pyb, args, 'feature_check/native_check.py') native = run_micropython(pyb, args, 'feature_check/native_check.py')
@ -222,6 +223,11 @@ def run_tests(pyb, tests, args):
if native == b'CRASH': if native == b'CRASH':
skip_async = True 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 # 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') t = run_micropython(pyb, args, 'feature_check/repl_emacs_check.py')
if not 'True' in str(t, 'ascii'): 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_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_set_type = test_name.startswith("set_") or test_name.startswith("frozenset")
is_async = test_name.startswith("async_") is_async = test_name.startswith("async_")
is_const = test_name.startswith("const")
skip_it = test_file in skip_tests skip_it = test_file in skip_tests
skip_it |= skip_native and is_native 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_int_big and is_int_big
skip_it |= skip_set_type and is_set_type skip_it |= skip_set_type and is_set_type
skip_it |= skip_async and is_async skip_it |= skip_async and is_async
skip_it |= skip_const and is_const
if skip_it: if skip_it:
print("skip ", test_file) print("skip ", test_file)