Skip to content
9 changes: 7 additions & 2 deletions sycl/test-e2e/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,13 @@ def get_extra_env(sycl_devices):
new_script.append(directive)
continue

# Filter commands based on split-mode
is_run_line = any(
# Filter commands based on testing mode
ignore_line_filtering = (
"build-and-run-mode" in test.requires
and test.config.test_mode == "run-only"
and test.config.fallback_build_run_only
)
is_run_line = ignore_line_filtering or any(
i in directive.command
for i in ["%{run}", "%{run-unfiltered-devices}", "%if run-mode"]
)
Expand Down
4 changes: 4 additions & 0 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@

# test-mode: Set if tests should run normally or only build/run
config.test_mode = lit_config.params.get("test-mode", "full")
config.fallback_build_run_only = False
if config.test_mode == "full":
config.available_features.add("run-mode")
config.available_features.add("build-and-run-mode")
elif config.test_mode == "run-only":
lit_config.note("run-only test mode enabled, only executing tests")
config.available_features.add("run-mode")
if lit_config.params.get("build-instead-of-skip-run-only", False):
config.available_features.add("build-and-run-mode")
config.fallback_build_run_only = True
elif config.test_mode == "build-only":
lit_config.note("build-only test mode enabled, only compiling tests")
config.sycl_devices = []
Expand Down
Loading