[Lldb-commits] [lldb] c2fb503 - [lldb][windows] Make skipUnlessMSVC tolerate cl.exe not in PATH (#198290)

via lldb-commits lldb-commits at lists.llvm.org
Mon May 18 06:09:05 PDT 2026


Author: Charles Zablit
Date: 2026-05-18T15:08:59+02:00
New Revision: c2fb503a4b49f02595ac8357aae7148b32da074b

URL: https://github.com/llvm/llvm-project/commit/c2fb503a4b49f02595ac8357aae7148b32da074b
DIFF: https://github.com/llvm/llvm-project/commit/c2fb503a4b49f02595ac8357aae7148b32da074b.diff

LOG: [lldb][windows] Make skipUnlessMSVC tolerate cl.exe not in PATH (#198290)

If `cl.exe` is not in the PATH, `subprocess.run([\"cl.exe\"])` raises
`FileNotFoundError`. This marks the test as `UNRESOLVED` instead of
`SKIPPED`.

This patch makes sure lit catches `FileNotFoundError` so the test is
skipped cleanly.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/decorators.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index e0567e99e16b7..9df99d9130316 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1132,11 +1132,14 @@ def skipUnlessMSVC(func):
     """Decorate the item to skip test unless msvc is available."""
 
     def is_msvc_in_path():
-        result = subprocess.run(
-            ["cl.exe"],
-            capture_output=True,
-            text=True,
-        )
+        try:
+            result = subprocess.run(
+                ["cl.exe"],
+                capture_output=True,
+                text=True,
+            )
+        except FileNotFoundError:
+            return f"Test requires MSVC to be in the Path."
         if result.returncode != 0:
             return f"Test requires MSVC to be in the Path."
         return None


        


More information about the lldb-commits mailing list