Author: vedantk Date: Tue Oct 16 11:13:42 2018 New Revision: 344634 URL: http://llvm.org/viewvc/llvm-project?rev=344634&view=rev Log: Use a relaxed substring check for function names in a test
The TestTailCallFrameSBAPI.py test checks that function names in a backtrace are equal to an expected value. Use a relaxed substring check because function dislpay names are platform-dependent. E.g we see "void sink(void)" on Windows, but "sink()" on Darwin. This seems like a bug -- just work around it for now. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py?rev=344634&r1=344633&r2=344634&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py Tue Oct 16 11:13:42 2018 @@ -57,9 +57,14 @@ class TestTailCallFrameSBAPI(TestBase): # frame #2: ... a.out`func2() at main.cpp:18:62 [opt] # frame #3: ... a.out`func1() at main.cpp:18:85 [opt] [artificial] # frame #4: ... a.out`main at main.cpp:23:3 [opt] - names = ["sink()", "func3()", "func2()", "func1()", "main"] + names = ["sink", "func3", "func2", "func1", "main"] artificiality = [False, True, False, True, False] for idx, (name, is_artificial) in enumerate(zip(names, artificiality)): frame = thread.GetFrameAtIndex(idx) - self.assertEqual(frame.GetDisplayFunctionName(), name) + + # Use a relaxed substring check because function dislpay names are + # platform-dependent. E.g we see "void sink(void)" on Windows, but + # "sink()" on Darwin. This seems like a bug -- just work around it + # for now. + self.assertTrue(name in frame.GetDisplayFunctionName()) self.assertEqual(frame.IsArtificial(), is_artificial) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits