[Lldb-commits] [lldb] [lldb] Rally around triple rather than arch in the API tests (PR #191416)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 10 06:59:48 PDT 2026


================
@@ -6,69 +6,23 @@
 from lldbsuite.test import configuration
 import lldbsuite.test.lldbutil as lldbutil
 
-REMOTE_PLATFORM_NAME_RE = re.compile(r"^remote-(.+)$")
-SIMULATOR_PLATFORM_RE = re.compile(r"^(.+)-simulator$")
+TRIPLE_RE = re.compile(
+    r"^(?P<arch>[a-zA-Z0-9_]+)"  # arch (required)
+    r"(?:-(?P<vendor>[a-zA-Z0-9_]+))?"  # vendor (optional)
+    r"(?:-(?P<os>[a-zA-Z_]+)(?P<os_version>[\d.]+)?)?"  # os + version (optional)
+    r"(?:-(?P<env>[a-zA-Z0-9_]+))?"  # env/abi (optional)
+    r"$"
----------------
DavidSpickett wrote:

https://docs.python.org/3/library/re.html#re.VERBOSE would be the Pythonic way to write it.

https://github.com/llvm/llvm-project/pull/191416


More information about the lldb-commits mailing list