[Lldb-commits] [lldb] r372224 - Fir TestAPILog for gcc

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 18 06:41:50 PDT 2019


Author: labath
Date: Wed Sep 18 06:41:50 2019
New Revision: 372224

URL: http://llvm.org/viewvc/llvm-project?rev=372224&view=rev
Log:
Fir TestAPILog for gcc

different compilers will put different things into __PRETTY_FUNCTION__.
For instance gcc will not put a " " in the "const char *" argument,
causing our regex matching to fail.

This patch relaxes the regexes in this test to account for this
difference.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/api/log/TestAPILog.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/api/log/TestAPILog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/log/TestAPILog.py?rev=372224&r1=372223&r2=372224&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/api/log/TestAPILog.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/api/log/TestAPILog.py Wed Sep 18 06:41:50 2019
@@ -36,18 +36,16 @@ class APILogTestCase(TestBase):
 
         # Find the SBDebugger's address.
         debugger_addr = re.findall(
-            r"lldb::SBDebugger::GetScriptingLanguage\(const char \*\) \(0x([0-9a-fA-F]+),",
+            r"lldb::SBDebugger::GetScriptingLanguage\([^)]*\) \(0x([0-9a-fA-F]+),",
             log)
 
         # Make sure we've found a match.
         self.assertTrue(debugger_addr, log)
 
         # Make sure the GetScriptingLanguage matches.
-        get_scripting_language = 'lldb::SBDebugger::GetScriptingLanguage(const char *) (0x{}, "")'.format(
-            debugger_addr[0])
-        self.assertTrue(get_scripting_language in log, log)
+        self.assertTrue(re.search(r'lldb::SBDebugger::GetScriptingLanguage\([^)]*\) \(0x{}, ""\)'.format(
+            debugger_addr[0]), log), log)
 
         # Make sure the address matches.
-        create_target = 'lldb::SBDebugger::CreateTarget(const char *) (0x{}, "")'.format(
-            debugger_addr[0])
-        self.assertTrue(create_target in log, log)
+        self.assertTrue(re.search(r'lldb::SBDebugger::CreateTarget\([^)]*\) \(0x{}, ""\)'.format(
+            debugger_addr[0]), log), log)




More information about the lldb-commits mailing list