summaryrefslogtreecommitdiffstatshomepage
path: root/tests/run-tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-tests')
-rwxr-xr-xtests/run-tests24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/run-tests b/tests/run-tests
index 4ac7d8e28f..91282667d8 100755
--- a/tests/run-tests
+++ b/tests/run-tests
@@ -51,7 +51,7 @@ def convert_regex_escapes(line):
def run_micropython(pyb, args, test_file):
- special_tests = ('micropython/meminfo.py', 'basics/bytes_compare3.py')
+ special_tests = ('micropython/meminfo.py', 'basics/bytes_compare3.py', 'thread/thread_exc2.py')
is_special = False
if pyb is None:
# run on PC
@@ -99,6 +99,7 @@ def run_micropython(pyb, args, test_file):
stderr=subprocess.STDOUT, bufsize=0)
banner = get(True)
output_mupy = banner + b''.join(send_get(line) for line in f)
+ send_get(b'\x04') # exit the REPL, so coverage info is saved
p.kill()
os.close(master)
os.close(slave)
@@ -194,12 +195,18 @@ def run_tests(pyb, tests, args):
skip_tests = set()
skip_native = False
+ skip_set_type = 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')
if native == b'CRASH':
skip_native = True
+ # Check if set type (and set literals) is supported, and skip such tests if it's not
+ native = run_micropython(pyb, args, 'feature_check/set_check.py')
+ if native == b'CRASH':
+ skip_set_type = 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'):
@@ -207,6 +214,7 @@ def run_tests(pyb, tests, args):
upy_byteorder = run_micropython(pyb, args, 'feature_check/byteorder.py')
has_complex = run_micropython(pyb, args, 'feature_check/complex.py') == b'complex\n'
+ has_coverage = run_micropython(pyb, args, 'feature_check/coverage.py') == b'coverage\n'
cpy_byteorder = subprocess.check_output([CPYTHON3, 'feature_check/byteorder.py'])
skip_endian = (upy_byteorder != cpy_byteorder)
@@ -224,6 +232,9 @@ def run_tests(pyb, tests, args):
skip_tests.add('float/true_value.py')
skip_tests.add('float/types.py')
+ if not has_coverage:
+ skip_tests.add('cmdline/cmd_parsetree.py')
+
# Some tests shouldn't be run on a PC
if pyb is None:
# unix build does not have the GIL so can't run thread mutation tests
@@ -270,7 +281,7 @@ def run_tests(pyb, tests, args):
# Some tests are known to fail with native emitter
# Remove them from the below when they work
if args.emit == 'native':
- skip_tests.update({'basics/%s.py' % t for t in 'gen_yield_from gen_yield_from_close gen_yield_from_ducktype gen_yield_from_exc gen_yield_from_iter gen_yield_from_send gen_yield_from_stopped gen_yield_from_throw generator1 generator2 generator_args generator_close generator_closure generator_exc generator_return generator_send'.split()}) # require yield
+ skip_tests.update({'basics/%s.py' % t for t in 'gen_yield_from gen_yield_from_close gen_yield_from_ducktype gen_yield_from_exc gen_yield_from_iter gen_yield_from_send gen_yield_from_stopped gen_yield_from_throw gen_yield_from_throw2 generator1 generator2 generator_args generator_close generator_closure generator_exc generator_return generator_send'.split()}) # require yield
skip_tests.update({'basics/%s.py' % t for t in 'bytes_gen class_store_class globals_del string_join'.split()}) # require yield
skip_tests.update({'basics/async_%s.py' % t for t in 'def await await2 for for2 with with2'.split()}) # require yield
skip_tests.update({'basics/%s.py' % t for t in 'try_reraise try_reraise2'.split()}) # require raise_varargs
@@ -291,6 +302,7 @@ def run_tests(pyb, tests, args):
skip_tests.add('misc/rge_sm.py') # requires yield
skip_tests.add('misc/print_exception.py') # because native doesn't have proper traceback info
skip_tests.add('misc/sys_exc_info.py') # sys.exc_info() is not supported for native
+ skip_tests.add('micropython/heapalloc_traceback.py') # because native doesn't have proper traceback info
for test_file in tests:
test_file = test_file.replace('\\', '/')
@@ -298,8 +310,14 @@ def run_tests(pyb, tests, args):
test_name = os.path.splitext(test_basename)[0]
is_native = test_name.startswith("native_") or test_name.startswith("viper_")
is_endian = test_name.endswith("_endian")
+ is_set_type = test_name.startswith("set_")
+
+ 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
- if test_file in skip_tests or (skip_native and is_native) or (skip_endian and is_endian):
+ if skip_it:
print("skip ", test_file)
skipped_tests.append(test_name)
continue