Skip to content

Commit b099aeb

Browse files
committed
run-tests: Add feature check for "const" keyword and skip related tests.
1 parent b9e9cfc commit b099aeb

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

tests/feature_check/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
x = const(1)

tests/feature_check/const.py.exp

Whitespace-only changes.

tests/run-tests

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def run_tests(pyb, tests, args):
201201
skip_int_big = False
202202
skip_set_type = False
203203
skip_async = False
204+
skip_const = False
204205

205206
# Check if micropython.native is supported, and skip such tests if it's not
206207
native = run_micropython(pyb, args, 'feature_check/native_check.py')
@@ -222,6 +223,11 @@ def run_tests(pyb, tests, args):
222223
if native == b'CRASH':
223224
skip_async = True
224225

226+
# Check if const keyword (MicroPython extension) is supported, and skip such tests if it's not
227+
native = run_micropython(pyb, args, 'feature_check/const.py')
228+
if native == b'CRASH':
229+
skip_const = True
230+
225231
# Check if emacs repl is supported, and skip such tests if it's not
226232
t = run_micropython(pyb, args, 'feature_check/repl_emacs_check.py')
227233
if not 'True' in str(t, 'ascii'):
@@ -330,13 +336,15 @@ def run_tests(pyb, tests, args):
330336
is_int_big = test_name.startswith("int_big") or test_name.endswith("_intbig")
331337
is_set_type = test_name.startswith("set_") or test_name.startswith("frozenset")
332338
is_async = test_name.startswith("async_")
339+
is_const = test_name.startswith("const")
333340

334341
skip_it = test_file in skip_tests
335342
skip_it |= skip_native and is_native
336343
skip_it |= skip_endian and is_endian
337344
skip_it |= skip_int_big and is_int_big
338345
skip_it |= skip_set_type and is_set_type
339346
skip_it |= skip_async and is_async
347+
skip_it |= skip_const and is_const
340348

341349
if skip_it:
342350
print("skip ", test_file)

0 commit comments

Comments
 (0)