33from lldbsuite .test .lldbtest import *
44from lldbsuite .test import lldbutil
55
6+ import re
67
78class LibCxxInternalsRecognizerTestCase (TestBase ):
89 NO_DEBUG_INFO_TESTCASE = True
910
1011 @add_test_categories (["libc++" ])
11- @skipIf (compiler = "clang" , compiler_version = ["<" , "18 .0" ])
12+ @skipIf (compiler = "clang" , compiler_version = ["<" , "16 .0" ])
1213 def test_frame_recognizer (self ):
1314 """Test that implementation details of libc++ are hidden"""
1415 self .build ()
@@ -22,7 +23,7 @@ def test_frame_recognizer(self):
2223 # We never hide the frame of the entry-point into the standard library, even
2324 # if the name starts with `__` which usually indicates an internal function.
2425 "ranges_sort_less(int, int)" : [
25- "ranges::__sort::operator()" ,
26+ re . compile ( "ranges::__sort::(__fn::)? operator\(\)" ) ,
2627 "test_algorithms" ,
2728 ],
2829 # `ranges::views::transform` internally uses `std::invoke`, and that
@@ -58,9 +59,11 @@ def test_frame_recognizer(self):
5859 ):
5960 frame_id = frame_id + 1
6061 # Expect the correct parent frame
61- self .assertIn (
62- expected_parent , thread .GetFrameAtIndex (frame_id ).GetFunctionName ()
63- )
62+ func_name = thread .GetFrameAtIndex (frame_id ).GetFunctionName ()
63+ if isinstance (expected_parent , re .Pattern ):
64+ self .assertTrue (expected_parent .search (func_name ) is not None , f"'{ expected_parent } ' not found in '{ func_name } '" )
65+ else :
66+ self .assertIn (expected_parent , func_name )
6467 frame_id = frame_id + 1
6568 process .Continue ()
6669
0 commit comments