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
8 changes: 6 additions & 2 deletions sycl/test-e2e/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,14 @@ def execute(self, test, litConfig):
if isinstance(script, lit.Test.Result):
return script

unsplit_test = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know why, but something in me has a really huge dislike towards "unsplit" anywhere in regard to this feature...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to ignore_line_filtering, is that better?

if "build-and-run-mode" in test.requires:
unsplit_test = True

devices_for_test = []
triples = set()
if test.config.test_mode == "build-only":
if "build-and-run-mode" in test.requires or "true" in test.unsupported:
if unsplit_test or "true" in test.unsupported:
return lit.Test.Result(
lit.Test.UNSUPPORTED, "Test unsupported for this environment"
)
Expand Down Expand Up @@ -235,7 +239,7 @@ def get_extra_env(sycl_devices):
continue

# Filter commands based on split-mode
is_run_line = any(
is_run_line = (unsplit_test and test.config.fallback_build_run_only) 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 @@ -45,6 +45,10 @@
elif config.test_mode == "run-only":
lit_config.note("run-only test mode enabled, only executing tests")
config.available_features.add("run-mode")
config.fallback_build_run_only = False
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