Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][E2E] Add option to build tests on run-only mode if marked as REQUIRES: build-and-run-mode #16306

Merged
merged 12 commits into from
Dec 19, 2024
11 changes: 8 additions & 3 deletions sycl/test-e2e/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,19 @@ def get_extra_env(sycl_devices):
new_script.append(directive)
continue

# Filter commands based on split-mode
# Filter commands based on testing mode
is_run_line = any(
i in directive.command
for i in ["%{run}", "%{run-unfiltered-devices}", "%if run-mode"]
)

if (is_run_line and test.config.test_mode == "build-only") or (
not is_run_line and test.config.test_mode == "run-only"
ignore_line_filtering = (
"build-and-run-mode" in test.requires
and test.config.fallback_build_run_only
)
if not ignore_line_filtering and (
(is_run_line and test.config.test_mode == "build-only")
or (not is_run_line and test.config.test_mode == "run-only")
):
directive.command = ""

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")
aelovikov-intel marked this conversation as resolved.
Show resolved Hide resolved
config.fallback_build_run_only = True
ayylol marked this conversation as resolved.
Show resolved Hide resolved
elif config.test_mode == "build-only":
lit_config.note("build-only test mode enabled, only compiling tests")
config.sycl_devices = []
Expand Down
Loading