Skip to content

Commit

Permalink
[SYCL][E2E] Change pattern matching to if-else statements in `lit.cfg…
Browse files Browse the repository at this point in the history
….py` (#16217)

Fixes #16211
  • Loading branch information
ayylol authored Dec 4, 2024
1 parent 3f1aa18 commit 1c2e79c
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,18 @@
config.unsupported_features = []

# test-mode: Set if tests should run normally or only build/run
match lit_config.params.get("test-mode", "full"):
case "run-only":
config.test_mode = "run-only"
config.available_features.add("run-mode")
case "build-only":
config.test_mode = "build-only"
config.sycl_devices = []
case "full":
config.test_mode = "full"
config.available_features.add("run-mode")
config.available_features.add("build-and-run-mode")
case _:
lit_config.error("Invalid argument for test-mode")
config.test_mode = lit_config.params.get("test-mode", "full")
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")
elif config.test_mode == "build-only":
lit_config.note("build-only test mode enabled, only compiling tests")
config.sycl_devices = []
else:
lit_config.error("Invalid argument for test-mode")

# Cleanup environment variables which may affect tests
possibly_dangerous_env_vars = [
Expand Down

0 comments on commit 1c2e79c

Please sign in to comment.