From 1c2e79c48515fcce53ca0358f11cf5bedabdc292 Mon Sep 17 00:00:00 2001 From: David Garcia Orozco Date: Tue, 3 Dec 2024 18:10:53 -0700 Subject: [PATCH] [SYCL][E2E] Change pattern matching to if-else statements in `lit.cfg.py` (#16217) Fixes #16211 --- sycl/test-e2e/lit.cfg.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sycl/test-e2e/lit.cfg.py b/sycl/test-e2e/lit.cfg.py index c0e4e66da5d8c..76a70bea76f6e 100644 --- a/sycl/test-e2e/lit.cfg.py +++ b/sycl/test-e2e/lit.cfg.py @@ -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 = [