From ce2e0eeb7b0eeb8d5f188ec98e1f1b3d1307ca9c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 14 Feb 2017 22:03:25 +0300 Subject: [PATCH] tests/run-tests: Allow to skip tests using async/await keywords. --- tests/feature_check/async_check.py | 3 +++ tests/feature_check/async_check.py.exp | 0 tests/run-tests | 8 ++++++++ 3 files changed, 11 insertions(+) create mode 100644 tests/feature_check/async_check.py create mode 100644 tests/feature_check/async_check.py.exp diff --git a/tests/feature_check/async_check.py b/tests/feature_check/async_check.py new file mode 100644 index 0000000000..0f6361cd12 --- /dev/null +++ b/tests/feature_check/async_check.py @@ -0,0 +1,3 @@ +# check if async/await keywords are supported +async def foo(): + await 1 diff --git a/tests/feature_check/async_check.py.exp b/tests/feature_check/async_check.py.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/run-tests b/tests/run-tests index 24599ed64e..4bebe8d47f 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -199,6 +199,7 @@ def run_tests(pyb, tests, args): skip_tests = set() skip_native = False skip_set_type = False + skip_async = 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') @@ -210,6 +211,11 @@ def run_tests(pyb, tests, args): if native == b'CRASH': 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 t = run_micropython(pyb, args, 'feature_check/repl_emacs_check.py') 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_endian = test_name.endswith("_endian") 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 |= skip_native and is_native skip_it |= skip_endian and is_endian skip_it |= skip_set_type and is_set_type + skip_it |= skip_async and is_async if skip_it: print("skip ", test_file)