Skip to content

Commit 0a8b5d1

Browse files
committed
run-tests: Allow to skip byteorder-dependent tests.
If byteorder of MicroPython under test and host CPython differ.
1 parent 18c22fa commit 0a8b5d1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/run-tests

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ def run_tests(pyb, tests, args):
174174
skip_tests.add('cmdline/repl_emacs_check.py')
175175
skip_tests.add('cmdline/repl_emacs_keys.py')
176176

177+
upy_byteorder = run_micropython(pyb, args, 'byteorder.py')
178+
cpy_byteorder = subprocess.check_output([CPYTHON3, 'byteorder.py'])
179+
skip_endian = (upy_byteorder != cpy_byteorder)
180+
177181
# Some tests shouldn't be run under Travis CI
178182
if os.getenv('TRAVIS') == 'true':
179183
skip_tests.add('basics/memoryerror.py')
@@ -230,8 +234,9 @@ def run_tests(pyb, tests, args):
230234
test_basename = os.path.basename(test_file)
231235
test_name = os.path.splitext(test_basename)[0]
232236
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
237+
is_endian = test_name.endswith("_endian")
233238

234-
if test_file in skip_tests or (skip_native and is_native):
239+
if test_file in skip_tests or (skip_native and is_native) or (skip_endian and is_endian):
235240
print("skip ", test_file)
236241
skipped_tests.append(test_name)
237242
continue

0 commit comments

Comments
 (0)