1""" 2Similar to test_cfunction but test "py-bt-full" command. 3""" 4 5import re 6 7from .util import setup_module 8from .test_cfunction import CFunctionTests 9 10 11def setUpModule(): 12 setup_module() 13 14 15class CFunctionFullTests(CFunctionTests): 16 def check(self, func_name, cmd): 17 # Verify with "py-bt-full": 18 gdb_output = self.get_stack_trace( 19 cmd, 20 breakpoint=func_name, 21 cmds_after_breakpoint=['bt', 'py-bt-full'], 22 # bpo-45207: Ignore 'Function "meth_varargs" not 23 # defined.' message in stderr. 24 ignore_stderr=True, 25 ) 26 27 # bpo-46600: If the compiler inlines _null_to_none() in 28 # meth_varargs() (ex: clang -Og), _null_to_none() is the 29 # frame #1. Otherwise, meth_varargs() is the frame #1. 30 regex = r'#(1|2)' 31 regex += re.escape(f' <built-in method {func_name}') 32 self.assertRegex(gdb_output, regex) 33 34 35# Delete the test case, otherwise it's executed twice 36del CFunctionTests 37