Skip to content

Commit 1c2e79c

Browse files
authored
[SYCL][E2E] Change pattern matching to if-else statements in lit.cfg.py (#16217)
Fixes #16211
1 parent 3f1aa18 commit 1c2e79c

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

sycl/test-e2e/lit.cfg.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,18 @@
3838
config.unsupported_features = []
3939

4040
# test-mode: Set if tests should run normally or only build/run
41-
match lit_config.params.get("test-mode", "full"):
42-
case "run-only":
43-
config.test_mode = "run-only"
44-
config.available_features.add("run-mode")
45-
case "build-only":
46-
config.test_mode = "build-only"
47-
config.sycl_devices = []
48-
case "full":
49-
config.test_mode = "full"
50-
config.available_features.add("run-mode")
51-
config.available_features.add("build-and-run-mode")
52-
case _:
53-
lit_config.error("Invalid argument for test-mode")
41+
config.test_mode = lit_config.params.get("test-mode", "full")
42+
if config.test_mode == "full":
43+
config.available_features.add("run-mode")
44+
config.available_features.add("build-and-run-mode")
45+
elif config.test_mode == "run-only":
46+
lit_config.note("run-only test mode enabled, only executing tests")
47+
config.available_features.add("run-mode")
48+
elif config.test_mode == "build-only":
49+
lit_config.note("build-only test mode enabled, only compiling tests")
50+
config.sycl_devices = []
51+
else:
52+
lit_config.error("Invalid argument for test-mode")
5453

5554
# Cleanup environment variables which may affect tests
5655
possibly_dangerous_env_vars = [

0 commit comments

Comments
 (0)