From ecb77e40e079c6caef1391f48ff1ba7fab8fa68d Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 29 Oct 2019 21:44:22 +1100 Subject: [PATCH] tests: Add feature check for slice and skip corresponding tests. --- tests/feature_check/slice.py | 5 +++++ tests/feature_check/slice.py.exp | 0 tests/run-tests | 8 ++++++++ 3 files changed, 13 insertions(+) create mode 100644 tests/feature_check/slice.py create mode 100644 tests/feature_check/slice.py.exp diff --git a/tests/feature_check/slice.py b/tests/feature_check/slice.py new file mode 100644 index 0000000000..cdd42701af --- /dev/null +++ b/tests/feature_check/slice.py @@ -0,0 +1,5 @@ +try: + slice + print("slice") +except NameError: + print("no") diff --git a/tests/feature_check/slice.py.exp b/tests/feature_check/slice.py.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/run-tests b/tests/run-tests index 9e98125797..0fb72f3f68 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -223,6 +223,7 @@ def run_tests(pyb, tests, args, base_path="."): skip_int_big = False skip_bytearray = False skip_set_type = False + skip_slice = False skip_async = False skip_const = False skip_revops = False @@ -255,6 +256,11 @@ def run_tests(pyb, tests, args, base_path="."): if output == b'CRASH': skip_set_type = True + # Check if slice is supported, and skip such tests if it's not + output = run_feature_check(pyb, args, base_path, 'slice.py') + if output != b'slice\n': + skip_slice = True + # Check if async/await keywords are supported, and skip such tests if it's not output = run_feature_check(pyb, args, base_path, 'async_check.py') if output == b'CRASH': @@ -405,6 +411,7 @@ def run_tests(pyb, tests, args, base_path="."): is_int_big = test_name.startswith("int_big") or test_name.endswith("_intbig") is_bytearray = test_name.startswith("bytearray") or test_name.endswith("_bytearray") is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset") + is_slice = test_name.find("slice") != -1 is_async = test_name.startswith("async_") is_const = test_name.startswith("const") @@ -414,6 +421,7 @@ def run_tests(pyb, tests, args, base_path="."): skip_it |= skip_int_big and is_int_big skip_it |= skip_bytearray and is_bytearray skip_it |= skip_set_type and is_set_type + skip_it |= skip_slice and is_slice skip_it |= skip_async and is_async skip_it |= skip_const and is_const skip_it |= skip_revops and test_name.startswith("class_reverse_op")