Skip to content
9 changes: 8 additions & 1 deletion sycl/test-e2e/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def execute(self, test, litConfig):

devices_for_test = []
triples = set()
ignore_line_filtering = False
if test.config.test_mode == "build-only":
if "build-and-run-mode" in test.requires or "true" in test.unsupported:
return lit.Test.Result(
Expand All @@ -173,6 +174,12 @@ def execute(self, test, litConfig):
(backend, _) = sycl_device.split(":")
triples.add(get_triple(test, backend))

if (
"build-and-run-mode" in test.requires
and test.config.fallback_build_run_only
):
ignore_line_filtering = True
Copy link
Contributor

Choose a reason for hiding this comment

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

Why cannot that be done at the place when ignore_line_filtering will be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, i put this right outside of the loop where ignore_line_filtering is used.


substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
substitutions.append(("%{sycl_triple}", format(",".join(triples))))
# -fsycl-targets is needed for CUDA/HIP, so just use it be default so
Expand Down Expand Up @@ -235,7 +242,7 @@ def get_extra_env(sycl_devices):
continue

# Filter commands based on split-mode
is_run_line = any(
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