Skip to content

Commit c35427c

Browse files
committed
tests/run-tests.py: Move tests to skip with native emitter to a list.
This makes `run-tests.py` a little more organised, by putting all the tests-to-skip-when-using-the-native-emitter in a dedicated list. This should make it easier to maintain the list, and understand why a test is there. Signed-off-by: Damien George <[email protected]>
1 parent 7e8705f commit c35427c

File tree

1 file changed

+45
-40
lines changed

1 file changed

+45
-40
lines changed

tests/run-tests.py

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,48 @@ def open(self, path, mode):
102102
# Platforms associated with the unix port, values of `sys.platform`.
103103
PC_PLATFORMS = ("darwin", "linux", "win32")
104104

105+
# Tests to skip for specific emitters.
106+
emitter_tests_to_skip = {
107+
# Some tests are known to fail with native emitter.
108+
# Remove them from the below when they work.
109+
"native": (
110+
# These require raise_varargs.
111+
"basics/gen_yield_from_close.py",
112+
"basics/try_finally_return2.py",
113+
"basics/try_reraise.py",
114+
"basics/try_reraise2.py",
115+
"misc/features.py",
116+
# These require checking for unbound local.
117+
"basics/annotate_var.py",
118+
"basics/del_deref.py",
119+
"basics/del_local.py",
120+
"basics/scope_implicit.py",
121+
"basics/unboundlocal.py",
122+
# These require "raise from".
123+
"basics/exception_chain.py",
124+
# These require proper traceback info.
125+
"basics/sys_tracebacklimit.py",
126+
"misc/print_exception.py",
127+
"micropython/emg_exc.py",
128+
"micropython/heapalloc_traceback.py",
129+
"micropython/opt_level_lineno.py",
130+
# These require stack-allocated slice optimisation.
131+
"micropython/heapalloc_slice.py",
132+
# These require running the scheduler.
133+
"micropython/schedule.py",
134+
"extmod/asyncio_event_queue.py",
135+
"extmod/asyncio_iterator_event.py",
136+
# These require sys.exc_info().
137+
"misc/sys_exc_info.py",
138+
# These require sys.settrace().
139+
"misc/sys_settrace_features.py",
140+
"misc/sys_settrace_generator.py",
141+
"misc/sys_settrace_loop.py",
142+
# These are bytecode-specific tests.
143+
"stress/bytecode_limit.py",
144+
),
145+
}
146+
105147
# Tests to skip on specific targets.
106148
# These are tests that are difficult to detect that they should not be run on the given target.
107149
platform_tests_to_skip = {
@@ -824,6 +866,9 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
824866
skip_tests.add("basics/exception_chain.py") # warning is not printed
825867
skip_tests.add("micropython/meminfo.py") # output is very different to PC output
826868

869+
# Skip emitter-specific tests.
870+
skip_tests.update(emitter_tests_to_skip.get(args.emit, ()))
871+
827872
# Skip platform-specific tests.
828873
skip_tests.update(platform_tests_to_skip.get(args.platform, ()))
829874

@@ -837,46 +882,6 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
837882
# Works but CPython uses '\' path separator
838883
skip_tests.add("import/import_file.py")
839884

840-
# Some tests are known to fail with native emitter
841-
# Remove them from the below when they work
842-
if args.emit == "native":
843-
skip_tests.add("basics/gen_yield_from_close.py") # require raise_varargs
844-
skip_tests.update(
845-
{"basics/%s.py" % t for t in "try_reraise try_reraise2".split()}
846-
) # require raise_varargs
847-
skip_tests.add("basics/annotate_var.py") # requires checking for unbound local
848-
skip_tests.add("basics/del_deref.py") # requires checking for unbound local
849-
skip_tests.add("basics/del_local.py") # requires checking for unbound local
850-
skip_tests.add("basics/exception_chain.py") # raise from is not supported
851-
skip_tests.add("basics/scope_implicit.py") # requires checking for unbound local
852-
skip_tests.add("basics/sys_tracebacklimit.py") # requires traceback info
853-
skip_tests.add("basics/try_finally_return2.py") # requires raise_varargs
854-
skip_tests.add("basics/unboundlocal.py") # requires checking for unbound local
855-
skip_tests.add("misc/features.py") # requires raise_varargs
856-
skip_tests.add(
857-
"misc/print_exception.py"
858-
) # because native doesn't have proper traceback info
859-
skip_tests.add("misc/sys_exc_info.py") # sys.exc_info() is not supported for native
860-
skip_tests.add("misc/sys_settrace_features.py") # sys.settrace() not supported
861-
skip_tests.add("misc/sys_settrace_generator.py") # sys.settrace() not supported
862-
skip_tests.add("misc/sys_settrace_loop.py") # sys.settrace() not supported
863-
skip_tests.add(
864-
"micropython/emg_exc.py"
865-
) # because native doesn't have proper traceback info
866-
skip_tests.add(
867-
"micropython/heapalloc_slice.py"
868-
) # because native doesn't do the stack-allocated slice optimisation
869-
skip_tests.add(
870-
"micropython/heapalloc_traceback.py"
871-
) # because native doesn't have proper traceback info
872-
skip_tests.add(
873-
"micropython/opt_level_lineno.py"
874-
) # native doesn't have proper traceback info
875-
skip_tests.add("micropython/schedule.py") # native code doesn't check pending events
876-
skip_tests.add("stress/bytecode_limit.py") # bytecode specific test
877-
skip_tests.add("extmod/asyncio_event_queue.py") # native can't run schedule
878-
skip_tests.add("extmod/asyncio_iterator_event.py") # native can't run schedule
879-
880885
def run_one_test(test_file):
881886
test_file = test_file.replace("\\", "/")
882887
test_file_abspath = os.path.abspath(test_file).replace("\\", "/")

0 commit comments

Comments
 (0)