This revision was automatically updated to reflect the committed changes.
Closed by commit rG307b7a1d6658: [lldb/test] Clean up version checking. 
(authored by rupprecht).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88051/new/

https://reviews.llvm.org/D88051

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py


Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1364,15 +1364,13 @@
         """ Returns a string that represents the compiler version.
             Supports: llvm, clang.
         """
-        version = 'unknown'
-
         compiler = self.getCompilerBinary()
-        version_output = system([[compiler, "-v"]])
+        version_output = system([[compiler, "--version"]])
         for line in version_output.split(os.linesep):
-            m = re.search('version ([0-9\.]+)', line)
+            m = re.search('version ([0-9.]+)', line)
             if m:
-                version = m.group(1)
-        return version
+                return m.group(1)
+        return 'unknown'
 
     def getDwarfVersion(self):
         """ Returns the dwarf version generated by clang or '0'. """


Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1364,15 +1364,13 @@
         """ Returns a string that represents the compiler version.
             Supports: llvm, clang.
         """
-        version = 'unknown'
-
         compiler = self.getCompilerBinary()
-        version_output = system([[compiler, "-v"]])
+        version_output = system([[compiler, "--version"]])
         for line in version_output.split(os.linesep):
-            m = re.search('version ([0-9\.]+)', line)
+            m = re.search('version ([0-9.]+)', line)
             if m:
-                version = m.group(1)
-        return version
+                return m.group(1)
+        return 'unknown'
 
     def getDwarfVersion(self):
         """ Returns the dwarf version generated by clang or '0'. """
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] D... Jordan Rupprecht via Phabricator via lldb-commits
    • [Lldb-commits] [PAT... Jordan Rupprecht via Phabricator via lldb-commits

Reply via email to