summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gdb/test_backtrace.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-28 17:04:01 (GMT)
committerGitHub <noreply@github.com>2023-09-28 17:04:01 (GMT)
commit757cbd4f29c9e89b38b975e0463dc8ed331b2515 (patch)
tree84a65966c3e16e6833881568ad209ec936fac3ff /Lib/test/test_gdb/test_backtrace.py
parentc4eda57345f579947b128e6148ab7f77de44bb88 (diff)
downloadcpython-757cbd4f29c9e89b38b975e0463dc8ed331b2515.zip
cpython-757cbd4f29c9e89b38b975e0463dc8ed331b2515.tar.gz
cpython-757cbd4f29c9e89b38b975e0463dc8ed331b2515.tar.bz2
gh-109972: Enhance test_gdb (#110026)
* Split test_pycfunction.py: add test_cfunction_full.py. Split the function into the following 6 functions. In verbose mode, these "pycfunction" tests now log each tested call. * test_pycfunction_noargs() * test_pycfunction_o() * test_pycfunction_varargs() * test_pycfunction_varargs_keywords() * test_pycfunction_fastcall() * test_pycfunction_fastcall_keywords() * Move get_gdb_repr() to PrettyPrintTests. * Replace DebuggerTests.get_sample_script() with SAMPLE_SCRIPT. * Rename checkout_hook_path to CHECKOUT_HOOK_PATH. * Rename gdb_version to GDB_VERSION_TEXT. * Replace (gdb_major_version, gdb_minor_version) with GDB_VERSION. * run_gdb() uses "backslashreplace" error handler instead of "replace". * Add check_gdb() function to util.py. * Enhance support.check_cflags_pgo(): check also for sysconfig PGO_PROF_USE_FLAG (if available) in compiler flags. * Move some SkipTest checks to test_gdb/__init__.py. * Elaborate why gdb cannot be tested on Windows: gdb doesn't support PDB debug symbol files.
Diffstat (limited to 'Lib/test/test_gdb/test_backtrace.py')
-rw-r--r--Lib/test/test_gdb/test_backtrace.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_gdb/test_backtrace.py b/Lib/test/test_gdb/test_backtrace.py
index 15cbcf1..c41e7cb 100644
--- a/Lib/test/test_gdb/test_backtrace.py
+++ b/Lib/test/test_gdb/test_backtrace.py
@@ -3,7 +3,7 @@ import unittest
from test import support
from test.support import python_is_optimized
-from .util import setup_module, DebuggerTests, CET_PROTECTION
+from .util import setup_module, DebuggerTests, CET_PROTECTION, SAMPLE_SCRIPT
def setUpModule():
@@ -15,7 +15,7 @@ class PyBtTests(DebuggerTests):
"Python was compiled with optimizations")
def test_bt(self):
'Verify that the "py-bt" command works'
- bt = self.get_stack_trace(script=self.get_sample_script(),
+ bt = self.get_stack_trace(script=SAMPLE_SCRIPT,
cmds_after_breakpoint=['py-bt'])
self.assertMultilineMatches(bt,
r'''^.*
@@ -35,7 +35,7 @@ Traceback \(most recent call first\):
"Python was compiled with optimizations")
def test_bt_full(self):
'Verify that the "py-bt-full" command works'
- bt = self.get_stack_trace(script=self.get_sample_script(),
+ bt = self.get_stack_trace(script=SAMPLE_SCRIPT,
cmds_after_breakpoint=['py-bt-full'])
self.assertMultilineMatches(bt,
r'''^.*