From 89ad7f7a1ba245fccf1f64f95a146ada6f6aaac6 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 18 Sep 2019 13:41:50 +0000 Subject: [PATCH] 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. llvm-svn: 372224 --- lldb/packages/Python/lldbsuite/test/api/log/TestAPILog.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/api/log/TestAPILog.py b/lldb/packages/Python/lldbsuite/test/api/log/TestAPILog.py index f6fccad..c0ffa2c 100644 --- a/lldb/packages/Python/lldbsuite/test/api/log/TestAPILog.py +++ b/lldb/packages/Python/lldbsuite/test/api/log/TestAPILog.py @@ -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) -- 2.7.4