Skip to content

Commit

Permalink
tests/run-tests: Explicitly mark feature checks as special tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalcon committed Apr 11, 2017
1 parent f6e21b6 commit 5b93c20
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def convert_regex_escapes(line):
return bytes(''.join(cs), 'utf8')


def run_micropython(pyb, args, test_file):
def run_micropython(pyb, args, test_file, is_special=False):
special_tests = ('micropython/meminfo.py', 'basics/bytes_compare3.py', 'basics/builtin_help.py', 'thread/thread_exc2.py')
is_special = False
if pyb is None:
# run on PC
if test_file.startswith(('cmdline/', 'feature_check/')) or test_file in special_tests:
# special handling for tests of the unix cmdline program
is_special = True

if is_special:
# check for any cmdline options needed for this test
args = [MICROPYTHON]
with open(test_file, 'rb') as f:
Expand Down Expand Up @@ -209,33 +209,33 @@ def run_tests(pyb, tests, args, base_path="."):
skip_native = True

# Check if arbitrary-precision integers are supported, and skip such tests if it's not
native = run_micropython(pyb, args, base_path + '/feature_check/int_big.py')
native = run_micropython(pyb, args, base_path + '/feature_check/int_big.py', True)
if native != b'1000000000000000000000000000000000000000000000\n':
skip_int_big = True

# Check if set type (and set literals) is supported, and skip such tests if it's not
native = run_micropython(pyb, args, base_path + '/feature_check/set_check.py')
native = run_micropython(pyb, args, base_path + '/feature_check/set_check.py', True)
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, base_path + '/feature_check/async_check.py')
native = run_micropython(pyb, args, base_path + '/feature_check/async_check.py', True)
if native == b'CRASH':
skip_async = True

# Check if const keyword (MicroPython extension) is supported, and skip such tests if it's not
native = run_micropython(pyb, args, base_path + '/feature_check/const.py')
native = run_micropython(pyb, args, base_path + '/feature_check/const.py', True)
if native == b'CRASH':
skip_const = True

# Check if emacs repl is supported, and skip such tests if it's not
t = run_micropython(pyb, args, base_path + '/feature_check/repl_emacs_check.py')
t = run_micropython(pyb, args, base_path + '/feature_check/repl_emacs_check.py', True)
if not 'True' in str(t, 'ascii'):
skip_tests.add('cmdline/repl_emacs_keys.py')

upy_byteorder = run_micropython(pyb, args, base_path + '/feature_check/byteorder.py')
has_complex = run_micropython(pyb, args, base_path + '/feature_check/complex.py') == b'complex\n'
has_coverage = run_micropython(pyb, args, base_path + '/feature_check/coverage.py') == b'coverage\n'
has_coverage = run_micropython(pyb, args, base_path + '/feature_check/coverage.py', True) == b'coverage\n'
cpy_byteorder = subprocess.check_output([CPYTHON3, base_path + '/feature_check/byteorder.py'])
skip_endian = (upy_byteorder != cpy_byteorder)

Expand Down

0 comments on commit 5b93c20

Please sign in to comment.