tests/run-tests: Allow to skip tests using async/await keywords.
This commit is contained in:
parent
c6fd9ba4f3
commit
ce2e0eeb7b
|
@ -0,0 +1,3 @@
|
||||||
|
# check if async/await keywords are supported
|
||||||
|
async def foo():
|
||||||
|
await 1
|
|
@ -199,6 +199,7 @@ def run_tests(pyb, tests, args):
|
||||||
skip_tests = set()
|
skip_tests = set()
|
||||||
skip_native = False
|
skip_native = False
|
||||||
skip_set_type = False
|
skip_set_type = False
|
||||||
|
skip_async = 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')
|
||||||
|
@ -210,6 +211,11 @@ def run_tests(pyb, tests, args):
|
||||||
if native == b'CRASH':
|
if native == b'CRASH':
|
||||||
skip_set_type = True
|
skip_set_type = True
|
||||||
|
|
||||||
|
# Check if async/await keywords are supported, and skip such tests if it's not
|
||||||
|
native = run_micropython(pyb, args, 'feature_check/async_check.py')
|
||||||
|
if native == b'CRASH':
|
||||||
|
skip_async = 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'):
|
||||||
|
@ -314,11 +320,13 @@ def run_tests(pyb, tests, args):
|
||||||
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
|
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
|
||||||
is_endian = test_name.endswith("_endian")
|
is_endian = test_name.endswith("_endian")
|
||||||
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_")
|
||||||
|
|
||||||
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
|
||||||
skip_it |= skip_endian and is_endian
|
skip_it |= skip_endian and is_endian
|
||||||
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
|
||||||
|
|
||||||
if skip_it:
|
if skip_it:
|
||||||
print("skip ", test_file)
|
print("skip ", test_file)
|
||||||
|
|
Loading…
Reference in New Issue