• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Verify that gdb can pretty-print the various PyObject* types
2#
3# The code for testing gdb was adapted from similar work in Unladen Swallow's
4# Lib/test/test_jit_gdb.py
5
6import os
7import sysconfig
8import unittest
9from test import support
10
11
12if support.MS_WINDOWS:
13    # On Windows, Python is usually built by MSVC. Passing /p:DebugSymbols=true
14    # option to MSBuild produces PDB debug symbols, but gdb doesn't support PDB
15    # debug symbol files.
16    raise unittest.SkipTest("test_gdb doesn't work on Windows")
17
18if support.PGO:
19    raise unittest.SkipTest("test_gdb is not useful for PGO")
20
21if not sysconfig.is_python_build():
22    raise unittest.SkipTest("test_gdb only works on source builds at the moment.")
23
24if support.check_cflags_pgo():
25    raise unittest.SkipTest("test_gdb is not reliable on PGO builds")
26
27if support.check_bolt_optimized():
28    raise unittest.SkipTest("test_gdb is not reliable on BOLT optimized builds")
29
30
31def load_tests(*args):
32    return support.load_package_tests(os.path.dirname(__file__), *args)
33