Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 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 | |
| 6 | import os |
| 7 | import re |
| 8 | import subprocess |
| 9 | import sys |
| 10 | import unittest |
Antoine Pitrou | 22db735 | 2010-07-08 18:54:04 +0000 | [diff] [blame] | 11 | import sysconfig |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 12 | |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 13 | from test.test_support import run_unittest, findfile |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 14 | |
| 15 | try: |
| 16 | gdb_version, _ = subprocess.Popen(["gdb", "--version"], |
| 17 | stdout=subprocess.PIPE).communicate() |
| 18 | except OSError: |
| 19 | # This is what "no gdb" looks like. There may, however, be other |
| 20 | # errors that manifest this way too. |
| 21 | raise unittest.SkipTest("Couldn't find gdb on the path") |
| 22 | gdb_version_number = re.search(r"^GNU gdb [^\d]*(\d+)\.", gdb_version) |
| 23 | if int(gdb_version_number.group(1)) < 7: |
| 24 | raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding" |
| 25 | " Saw:\n" + gdb_version) |
| 26 | |
| 27 | # Verify that "gdb" was built with the embedded python support enabled: |
| 28 | cmd = "--eval-command=python import sys; print sys.version_info" |
| 29 | p = subprocess.Popen(["gdb", "--batch", cmd], |
| 30 | stdout=subprocess.PIPE) |
| 31 | gdbpy_version, _ = p.communicate() |
| 32 | if gdbpy_version == '': |
| 33 | raise unittest.SkipTest("gdb not built with embedded python support") |
| 34 | |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 35 | def gdb_has_frame_select(): |
| 36 | # Does this build of gdb have gdb.Frame.select ? |
| 37 | cmd = "--eval-command=python print(dir(gdb.Frame))" |
| 38 | p = subprocess.Popen(["gdb", "--batch", cmd], |
| 39 | stdout=subprocess.PIPE) |
| 40 | stdout, _ = p.communicate() |
| 41 | m = re.match(r'.*\[(.*)\].*', stdout) |
| 42 | if not m: |
| 43 | raise unittest.SkipTest("Unable to parse output from gdb.Frame.select test") |
| 44 | gdb_frame_dir = m.group(1).split(', ') |
| 45 | return "'select'" in gdb_frame_dir |
| 46 | |
| 47 | HAS_PYUP_PYDOWN = gdb_has_frame_select() |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 48 | |
| 49 | class DebuggerTests(unittest.TestCase): |
| 50 | |
| 51 | """Test that the debugger can debug Python.""" |
| 52 | |
| 53 | def run_gdb(self, *args): |
| 54 | """Runs gdb with the command line given by *args. |
| 55 | |
| 56 | Returns its stdout, stderr |
| 57 | """ |
| 58 | out, err = subprocess.Popen( |
| 59 | args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
| 60 | ).communicate() |
| 61 | return out, err |
| 62 | |
| 63 | def get_stack_trace(self, source=None, script=None, |
| 64 | breakpoint='PyObject_Print', |
| 65 | cmds_after_breakpoint=None, |
| 66 | import_site=False): |
| 67 | ''' |
| 68 | Run 'python -c SOURCE' under gdb with a breakpoint. |
| 69 | |
| 70 | Support injecting commands after the breakpoint is reached |
| 71 | |
| 72 | Returns the stdout from gdb |
| 73 | |
| 74 | cmds_after_breakpoint: if provided, a list of strings: gdb commands |
| 75 | ''' |
| 76 | # We use "set breakpoint pending yes" to avoid blocking with a: |
| 77 | # Function "foo" not defined. |
| 78 | # Make breakpoint pending on future shared library load? (y or [n]) |
| 79 | # error, which typically happens python is dynamically linked (the |
| 80 | # breakpoints of interest are to be found in the shared library) |
| 81 | # When this happens, we still get: |
| 82 | # Function "PyObject_Print" not defined. |
| 83 | # emitted to stderr each time, alas. |
| 84 | |
| 85 | # Initially I had "--eval-command=continue" here, but removed it to |
| 86 | # avoid repeated print breakpoints when traversing hierarchical data |
| 87 | # structures |
| 88 | |
| 89 | # Generate a list of commands in gdb's language: |
| 90 | commands = ['set breakpoint pending yes', |
| 91 | 'break %s' % breakpoint, |
| 92 | 'run'] |
| 93 | if cmds_after_breakpoint: |
| 94 | commands += cmds_after_breakpoint |
| 95 | else: |
| 96 | commands += ['backtrace'] |
| 97 | |
| 98 | # print commands |
| 99 | |
| 100 | # Use "commands" to generate the arguments with which to invoke "gdb": |
| 101 | args = ["gdb", "--batch"] |
| 102 | args += ['--eval-command=%s' % cmd for cmd in commands] |
| 103 | args += ["--args", |
| 104 | sys.executable] |
| 105 | |
| 106 | if not import_site: |
| 107 | # -S suppresses the default 'import site' |
| 108 | args += ["-S"] |
| 109 | |
| 110 | if source: |
| 111 | args += ["-c", source] |
| 112 | elif script: |
| 113 | args += [script] |
| 114 | |
| 115 | # print args |
| 116 | # print ' '.join(args) |
| 117 | |
| 118 | # Use "args" to invoke gdb, capturing stdout, stderr: |
| 119 | out, err = self.run_gdb(*args) |
| 120 | |
| 121 | # Ignore some noise on stderr due to the pending breakpoint: |
| 122 | err = err.replace('Function "%s" not defined.\n' % breakpoint, '') |
Antoine Pitrou | a815718 | 2010-05-05 18:29:02 +0000 | [diff] [blame] | 123 | # Ignore some other noise on stderr (http://bugs.python.org/issue8600) |
| 124 | err = err.replace("warning: Unable to find libthread_db matching" |
| 125 | " inferior's thread library, thread debugging will" |
| 126 | " not be available.\n", |
| 127 | '') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 128 | |
| 129 | # Ensure no unexpected error messages: |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 130 | self.assertEqual(err, '') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 131 | |
| 132 | return out |
| 133 | |
| 134 | def get_gdb_repr(self, source, |
| 135 | cmds_after_breakpoint=None, |
| 136 | import_site=False): |
| 137 | # Given an input python source representation of data, |
| 138 | # run "python -c'print DATA'" under gdb with a breakpoint on |
| 139 | # PyObject_Print and scrape out gdb's representation of the "op" |
| 140 | # parameter, and verify that the gdb displays the same string |
| 141 | # |
| 142 | # For a nested structure, the first time we hit the breakpoint will |
| 143 | # give us the top-level structure |
| 144 | gdb_output = self.get_stack_trace(source, breakpoint='PyObject_Print', |
| 145 | cmds_after_breakpoint=cmds_after_breakpoint, |
| 146 | import_site=import_site) |
R. David Murray | 0c08009 | 2010-04-05 16:28:49 +0000 | [diff] [blame] | 147 | # gdb can insert additional '\n' and space characters in various places |
| 148 | # in its output, depending on the width of the terminal it's connected |
| 149 | # to (using its "wrap_here" function) |
| 150 | m = re.match('.*#0\s+PyObject_Print\s+\(\s*op\=\s*(.*?),\s+fp=.*\).*', |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 151 | gdb_output, re.DOTALL) |
R. David Murray | 0c08009 | 2010-04-05 16:28:49 +0000 | [diff] [blame] | 152 | if not m: |
| 153 | self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output)) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 154 | return m.group(1), gdb_output |
| 155 | |
| 156 | def assertEndsWith(self, actual, exp_end): |
| 157 | '''Ensure that the given "actual" string ends with "exp_end"''' |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 158 | self.assertTrue(actual.endswith(exp_end), |
| 159 | msg='%r did not end with %r' % (actual, exp_end)) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 160 | |
| 161 | def assertMultilineMatches(self, actual, pattern): |
| 162 | m = re.match(pattern, actual, re.DOTALL) |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 163 | self.assertTrue(m, msg='%r did not match %r' % (actual, pattern)) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 164 | |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 165 | def get_sample_script(self): |
| 166 | return findfile('gdb_sample.py') |
| 167 | |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 168 | class PrettyPrintTests(DebuggerTests): |
| 169 | def test_getting_backtrace(self): |
| 170 | gdb_output = self.get_stack_trace('print 42') |
| 171 | self.assertTrue('PyObject_Print' in gdb_output) |
| 172 | |
| 173 | def assertGdbRepr(self, val, cmds_after_breakpoint=None): |
| 174 | # Ensure that gdb's rendering of the value in a debugged process |
| 175 | # matches repr(value) in this process: |
| 176 | gdb_repr, gdb_output = self.get_gdb_repr('print ' + repr(val), |
| 177 | cmds_after_breakpoint) |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 178 | self.assertEqual(gdb_repr, repr(val), gdb_output) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 179 | |
| 180 | def test_int(self): |
| 181 | 'Verify the pretty-printing of various "int" values' |
| 182 | self.assertGdbRepr(42) |
| 183 | self.assertGdbRepr(0) |
| 184 | self.assertGdbRepr(-7) |
| 185 | self.assertGdbRepr(sys.maxint) |
| 186 | self.assertGdbRepr(-sys.maxint) |
| 187 | |
| 188 | def test_long(self): |
| 189 | 'Verify the pretty-printing of various "long" values' |
| 190 | self.assertGdbRepr(0L) |
| 191 | self.assertGdbRepr(1000000000000L) |
| 192 | self.assertGdbRepr(-1L) |
| 193 | self.assertGdbRepr(-1000000000000000L) |
| 194 | |
| 195 | def test_singletons(self): |
| 196 | 'Verify the pretty-printing of True, False and None' |
| 197 | self.assertGdbRepr(True) |
| 198 | self.assertGdbRepr(False) |
| 199 | self.assertGdbRepr(None) |
| 200 | |
| 201 | def test_dicts(self): |
| 202 | 'Verify the pretty-printing of dictionaries' |
| 203 | self.assertGdbRepr({}) |
| 204 | self.assertGdbRepr({'foo': 'bar'}) |
| 205 | self.assertGdbRepr({'foo': 'bar', 'douglas':42}) |
| 206 | |
| 207 | def test_lists(self): |
| 208 | 'Verify the pretty-printing of lists' |
| 209 | self.assertGdbRepr([]) |
| 210 | self.assertGdbRepr(range(5)) |
| 211 | |
| 212 | def test_strings(self): |
| 213 | 'Verify the pretty-printing of strings' |
| 214 | self.assertGdbRepr('') |
| 215 | self.assertGdbRepr('And now for something hopefully the same') |
| 216 | self.assertGdbRepr('string with embedded NUL here \0 and then some more text') |
| 217 | self.assertGdbRepr('this is byte 255:\xff and byte 128:\x80') |
| 218 | |
| 219 | def test_tuples(self): |
| 220 | 'Verify the pretty-printing of tuples' |
| 221 | self.assertGdbRepr(tuple()) |
| 222 | self.assertGdbRepr((1,)) |
| 223 | self.assertGdbRepr(('foo', 'bar', 'baz')) |
| 224 | |
| 225 | def test_unicode(self): |
| 226 | 'Verify the pretty-printing of unicode values' |
| 227 | # Test the empty unicode string: |
| 228 | self.assertGdbRepr(u'') |
| 229 | |
| 230 | self.assertGdbRepr(u'hello world') |
| 231 | |
| 232 | # Test printing a single character: |
| 233 | # U+2620 SKULL AND CROSSBONES |
| 234 | self.assertGdbRepr(u'\u2620') |
| 235 | |
| 236 | # Test printing a Japanese unicode string |
| 237 | # (I believe this reads "mojibake", using 3 characters from the CJK |
| 238 | # Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE) |
| 239 | self.assertGdbRepr(u'\u6587\u5b57\u5316\u3051') |
| 240 | |
| 241 | # Test a character outside the BMP: |
| 242 | # U+1D121 MUSICAL SYMBOL C CLEF |
| 243 | # This is: |
| 244 | # UTF-8: 0xF0 0x9D 0x84 0xA1 |
| 245 | # UTF-16: 0xD834 0xDD21 |
Victor Stinner | b1556c5 | 2010-05-20 11:29:45 +0000 | [diff] [blame] | 246 | # This will only work on wide-unicode builds: |
| 247 | self.assertGdbRepr(u"\U0001D121") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 248 | |
| 249 | def test_sets(self): |
| 250 | 'Verify the pretty-printing of sets' |
| 251 | self.assertGdbRepr(set()) |
| 252 | self.assertGdbRepr(set(['a', 'b'])) |
| 253 | self.assertGdbRepr(set([4, 5, 6])) |
| 254 | |
| 255 | # Ensure that we handled sets containing the "dummy" key value, |
| 256 | # which happens on deletion: |
| 257 | gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b']) |
| 258 | s.pop() |
| 259 | print s''') |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 260 | self.assertEqual(gdb_repr, "set(['b'])") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 261 | |
| 262 | def test_frozensets(self): |
| 263 | 'Verify the pretty-printing of frozensets' |
| 264 | self.assertGdbRepr(frozenset()) |
| 265 | self.assertGdbRepr(frozenset(['a', 'b'])) |
| 266 | self.assertGdbRepr(frozenset([4, 5, 6])) |
| 267 | |
| 268 | def test_exceptions(self): |
| 269 | # Test a RuntimeError |
| 270 | gdb_repr, gdb_output = self.get_gdb_repr(''' |
| 271 | try: |
| 272 | raise RuntimeError("I am an error") |
| 273 | except RuntimeError, e: |
| 274 | print e |
| 275 | ''') |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 276 | self.assertEqual(gdb_repr, |
| 277 | "exceptions.RuntimeError('I am an error',)") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 278 | |
| 279 | |
| 280 | # Test division by zero: |
| 281 | gdb_repr, gdb_output = self.get_gdb_repr(''' |
| 282 | try: |
| 283 | a = 1 / 0 |
| 284 | except ZeroDivisionError, e: |
| 285 | print e |
| 286 | ''') |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 287 | self.assertEqual(gdb_repr, |
| 288 | "exceptions.ZeroDivisionError('integer division or modulo by zero',)") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 289 | |
| 290 | def test_classic_class(self): |
| 291 | 'Verify the pretty-printing of classic class instances' |
| 292 | gdb_repr, gdb_output = self.get_gdb_repr(''' |
| 293 | class Foo: |
| 294 | pass |
| 295 | foo = Foo() |
| 296 | foo.an_int = 42 |
| 297 | print foo''') |
| 298 | m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr) |
| 299 | self.assertTrue(m, |
| 300 | msg='Unexpected classic-class rendering %r' % gdb_repr) |
| 301 | |
| 302 | def test_modern_class(self): |
| 303 | 'Verify the pretty-printing of new-style class instances' |
| 304 | gdb_repr, gdb_output = self.get_gdb_repr(''' |
| 305 | class Foo(object): |
| 306 | pass |
| 307 | foo = Foo() |
| 308 | foo.an_int = 42 |
| 309 | print foo''') |
| 310 | m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr) |
| 311 | self.assertTrue(m, |
| 312 | msg='Unexpected new-style class rendering %r' % gdb_repr) |
| 313 | |
| 314 | def test_subclassing_list(self): |
| 315 | 'Verify the pretty-printing of an instance of a list subclass' |
| 316 | gdb_repr, gdb_output = self.get_gdb_repr(''' |
| 317 | class Foo(list): |
| 318 | pass |
| 319 | foo = Foo() |
| 320 | foo += [1, 2, 3] |
| 321 | foo.an_int = 42 |
| 322 | print foo''') |
| 323 | m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr) |
| 324 | self.assertTrue(m, |
| 325 | msg='Unexpected new-style class rendering %r' % gdb_repr) |
| 326 | |
| 327 | def test_subclassing_tuple(self): |
| 328 | 'Verify the pretty-printing of an instance of a tuple subclass' |
| 329 | # This should exercise the negative tp_dictoffset code in the |
| 330 | # new-style class support |
| 331 | gdb_repr, gdb_output = self.get_gdb_repr(''' |
| 332 | class Foo(tuple): |
| 333 | pass |
| 334 | foo = Foo((1, 2, 3)) |
| 335 | foo.an_int = 42 |
| 336 | print foo''') |
| 337 | m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr) |
| 338 | self.assertTrue(m, |
| 339 | msg='Unexpected new-style class rendering %r' % gdb_repr) |
| 340 | |
Martin v. Löwis | 7f7765c | 2010-04-12 05:18:16 +0000 | [diff] [blame] | 341 | def assertSane(self, source, corruption, expvalue=None, exptype=None): |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 342 | '''Run Python under gdb, corrupting variables in the inferior process |
| 343 | immediately before taking a backtrace. |
| 344 | |
| 345 | Verify that the variable's representation is the expected failsafe |
| 346 | representation''' |
| 347 | if corruption: |
| 348 | cmds_after_breakpoint=[corruption, 'backtrace'] |
| 349 | else: |
| 350 | cmds_after_breakpoint=['backtrace'] |
| 351 | |
| 352 | gdb_repr, gdb_output = \ |
| 353 | self.get_gdb_repr(source, |
| 354 | cmds_after_breakpoint=cmds_after_breakpoint) |
Martin v. Löwis | 7f7765c | 2010-04-12 05:18:16 +0000 | [diff] [blame] | 355 | |
| 356 | if expvalue: |
| 357 | if gdb_repr == repr(expvalue): |
| 358 | # gdb managed to print the value in spite of the corruption; |
| 359 | # this is good (see http://bugs.python.org/issue8330) |
| 360 | return |
| 361 | |
| 362 | if exptype: |
| 363 | pattern = '<' + exptype + ' at remote 0x[0-9a-f]+>' |
| 364 | else: |
| 365 | # Match anything for the type name; 0xDEADBEEF could point to |
| 366 | # something arbitrary (see http://bugs.python.org/issue8330) |
| 367 | pattern = '<.* at remote 0x[0-9a-f]+>' |
| 368 | |
| 369 | m = re.match(pattern, gdb_repr) |
| 370 | if not m: |
| 371 | self.fail('Unexpected gdb representation: %r\n%s' % \ |
| 372 | (gdb_repr, gdb_output)) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 373 | |
| 374 | def test_NULL_ptr(self): |
| 375 | 'Ensure that a NULL PyObject* is handled gracefully' |
| 376 | gdb_repr, gdb_output = ( |
| 377 | self.get_gdb_repr('print 42', |
| 378 | cmds_after_breakpoint=['set variable op=0', |
R. David Murray | 0c08009 | 2010-04-05 16:28:49 +0000 | [diff] [blame] | 379 | 'backtrace']) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 380 | ) |
| 381 | |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 382 | self.assertEqual(gdb_repr, '0x0') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 383 | |
| 384 | def test_NULL_ob_type(self): |
| 385 | 'Ensure that a PyObject* with NULL ob_type is handled gracefully' |
| 386 | self.assertSane('print 42', |
| 387 | 'set op->ob_type=0') |
| 388 | |
| 389 | def test_corrupt_ob_type(self): |
| 390 | 'Ensure that a PyObject* with a corrupt ob_type is handled gracefully' |
| 391 | self.assertSane('print 42', |
Martin v. Löwis | 7f7765c | 2010-04-12 05:18:16 +0000 | [diff] [blame] | 392 | 'set op->ob_type=0xDEADBEEF', |
| 393 | expvalue=42) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 394 | |
| 395 | def test_corrupt_tp_flags(self): |
| 396 | 'Ensure that a PyObject* with a type with corrupt tp_flags is handled' |
| 397 | self.assertSane('print 42', |
| 398 | 'set op->ob_type->tp_flags=0x0', |
Martin v. Löwis | 7f7765c | 2010-04-12 05:18:16 +0000 | [diff] [blame] | 399 | expvalue=42) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 400 | |
| 401 | def test_corrupt_tp_name(self): |
| 402 | 'Ensure that a PyObject* with a type with corrupt tp_name is handled' |
| 403 | self.assertSane('print 42', |
Martin v. Löwis | 7f7765c | 2010-04-12 05:18:16 +0000 | [diff] [blame] | 404 | 'set op->ob_type->tp_name=0xDEADBEEF', |
| 405 | expvalue=42) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 406 | |
| 407 | def test_NULL_instance_dict(self): |
| 408 | 'Ensure that a PyInstanceObject with with a NULL in_dict is handled' |
| 409 | self.assertSane(''' |
| 410 | class Foo: |
| 411 | pass |
| 412 | foo = Foo() |
| 413 | foo.an_int = 42 |
| 414 | print foo''', |
| 415 | 'set ((PyInstanceObject*)op)->in_dict = 0', |
Martin v. Löwis | 7f7765c | 2010-04-12 05:18:16 +0000 | [diff] [blame] | 416 | exptype='Foo') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 417 | |
| 418 | def test_builtins_help(self): |
| 419 | 'Ensure that the new-style class _Helper in site.py can be handled' |
| 420 | # (this was the issue causing tracebacks in |
| 421 | # http://bugs.python.org/issue8032#msg100537 ) |
| 422 | |
| 423 | gdb_repr, gdb_output = self.get_gdb_repr('print __builtins__.help', import_site=True) |
| 424 | m = re.match(r'<_Helper at remote 0x[0-9a-f]+>', gdb_repr) |
| 425 | self.assertTrue(m, |
| 426 | msg='Unexpected rendering %r' % gdb_repr) |
| 427 | |
| 428 | def test_selfreferential_list(self): |
| 429 | '''Ensure that a reference loop involving a list doesn't lead proxyval |
| 430 | into an infinite loop:''' |
| 431 | gdb_repr, gdb_output = \ |
| 432 | self.get_gdb_repr("a = [3, 4, 5] ; a.append(a) ; print a") |
| 433 | |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 434 | self.assertEqual(gdb_repr, '[3, 4, 5, [...]]') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 435 | |
| 436 | gdb_repr, gdb_output = \ |
| 437 | self.get_gdb_repr("a = [3, 4, 5] ; b = [a] ; a.append(b) ; print a") |
| 438 | |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 439 | self.assertEqual(gdb_repr, '[3, 4, 5, [[...]]]') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 440 | |
| 441 | def test_selfreferential_dict(self): |
| 442 | '''Ensure that a reference loop involving a dict doesn't lead proxyval |
| 443 | into an infinite loop:''' |
| 444 | gdb_repr, gdb_output = \ |
| 445 | self.get_gdb_repr("a = {} ; b = {'bar':a} ; a['foo'] = b ; print a") |
| 446 | |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 447 | self.assertEqual(gdb_repr, "{'foo': {'bar': {...}}}") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 448 | |
| 449 | def test_selfreferential_old_style_instance(self): |
| 450 | gdb_repr, gdb_output = \ |
| 451 | self.get_gdb_repr(''' |
| 452 | class Foo: |
| 453 | pass |
| 454 | foo = Foo() |
| 455 | foo.an_attr = foo |
| 456 | print foo''') |
| 457 | self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>', |
| 458 | gdb_repr), |
| 459 | 'Unexpected gdb representation: %r\n%s' % \ |
| 460 | (gdb_repr, gdb_output)) |
| 461 | |
| 462 | def test_selfreferential_new_style_instance(self): |
| 463 | gdb_repr, gdb_output = \ |
| 464 | self.get_gdb_repr(''' |
| 465 | class Foo(object): |
| 466 | pass |
| 467 | foo = Foo() |
| 468 | foo.an_attr = foo |
| 469 | print foo''') |
| 470 | self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>', |
| 471 | gdb_repr), |
| 472 | 'Unexpected gdb representation: %r\n%s' % \ |
| 473 | (gdb_repr, gdb_output)) |
| 474 | |
| 475 | gdb_repr, gdb_output = \ |
| 476 | self.get_gdb_repr(''' |
| 477 | class Foo(object): |
| 478 | pass |
| 479 | a = Foo() |
| 480 | b = Foo() |
| 481 | a.an_attr = b |
| 482 | b.an_attr = a |
| 483 | print a''') |
| 484 | self.assertTrue(re.match('<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>\) at remote 0x[0-9a-f]+>', |
| 485 | gdb_repr), |
| 486 | 'Unexpected gdb representation: %r\n%s' % \ |
| 487 | (gdb_repr, gdb_output)) |
| 488 | |
| 489 | def test_truncation(self): |
| 490 | 'Verify that very long output is truncated' |
| 491 | gdb_repr, gdb_output = self.get_gdb_repr('print range(1000)') |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 492 | self.assertEqual(gdb_repr, |
| 493 | "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, " |
| 494 | "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, " |
| 495 | "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, " |
| 496 | "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, " |
| 497 | "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, " |
| 498 | "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, " |
| 499 | "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, " |
| 500 | "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, " |
| 501 | "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, " |
| 502 | "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, " |
| 503 | "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, " |
| 504 | "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, " |
| 505 | "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, " |
| 506 | "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, " |
| 507 | "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, " |
| 508 | "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, " |
| 509 | "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, " |
| 510 | "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, " |
| 511 | "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, " |
| 512 | "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, " |
| 513 | "224, 225, 226...(truncated)") |
| 514 | self.assertEqual(len(gdb_repr), |
| 515 | 1024 + len('...(truncated)')) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 516 | |
| 517 | def test_builtin_function(self): |
| 518 | gdb_repr, gdb_output = self.get_gdb_repr('print len') |
Ezio Melotti | 2623a37 | 2010-11-21 13:34:58 +0000 | [diff] [blame^] | 519 | self.assertEqual(gdb_repr, '<built-in function len>') |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 520 | |
| 521 | def test_builtin_method(self): |
| 522 | gdb_repr, gdb_output = self.get_gdb_repr('import sys; print sys.stdout.readlines') |
| 523 | self.assertTrue(re.match('<built-in method readlines of file object at remote 0x[0-9a-f]+>', |
| 524 | gdb_repr), |
| 525 | 'Unexpected gdb representation: %r\n%s' % \ |
| 526 | (gdb_repr, gdb_output)) |
| 527 | |
| 528 | def test_frames(self): |
| 529 | gdb_output = self.get_stack_trace(''' |
| 530 | def foo(a, b, c): |
| 531 | pass |
| 532 | |
| 533 | foo(3, 4, 5) |
| 534 | print foo.__code__''', |
| 535 | breakpoint='PyObject_Print', |
| 536 | cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)op)->co_zombieframe)'] |
| 537 | ) |
R. David Murray | 0c08009 | 2010-04-05 16:28:49 +0000 | [diff] [blame] | 538 | self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*', |
| 539 | gdb_output, |
| 540 | re.DOTALL), |
| 541 | 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output)) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 542 | |
| 543 | class PyListTests(DebuggerTests): |
| 544 | def assertListing(self, expected, actual): |
| 545 | self.assertEndsWith(actual, expected) |
| 546 | |
| 547 | def test_basic_command(self): |
| 548 | 'Verify that the "py-list" command works' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 549 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 550 | cmds_after_breakpoint=['py-list']) |
| 551 | |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 552 | self.assertListing(' 5 \n' |
| 553 | ' 6 def bar(a, b, c):\n' |
| 554 | ' 7 baz(a, b, c)\n' |
| 555 | ' 8 \n' |
| 556 | ' 9 def baz(*args):\n' |
| 557 | ' >10 print(42)\n' |
| 558 | ' 11 \n' |
| 559 | ' 12 foo(1, 2, 3)\n', |
| 560 | bt) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 561 | |
| 562 | def test_one_abs_arg(self): |
| 563 | 'Verify the "py-list" command with one absolute argument' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 564 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 565 | cmds_after_breakpoint=['py-list 9']) |
| 566 | |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 567 | self.assertListing(' 9 def baz(*args):\n' |
| 568 | ' >10 print(42)\n' |
| 569 | ' 11 \n' |
| 570 | ' 12 foo(1, 2, 3)\n', |
| 571 | bt) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 572 | |
| 573 | def test_two_abs_args(self): |
| 574 | 'Verify the "py-list" command with two absolute arguments' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 575 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 576 | cmds_after_breakpoint=['py-list 1,3']) |
| 577 | |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 578 | self.assertListing(' 1 # Sample script for use by test_gdb.py\n' |
| 579 | ' 2 \n' |
| 580 | ' 3 def foo(a, b, c):\n', |
| 581 | bt) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 582 | |
| 583 | class StackNavigationTests(DebuggerTests): |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 584 | @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 585 | def test_pyup_command(self): |
| 586 | 'Verify that the "py-up" command works' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 587 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 588 | cmds_after_breakpoint=['py-up']) |
| 589 | self.assertMultilineMatches(bt, |
| 590 | r'''^.* |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 591 | #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 592 | baz\(a, b, c\) |
| 593 | $''') |
| 594 | |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 595 | @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 596 | def test_down_at_bottom(self): |
| 597 | 'Verify handling of "py-down" at the bottom of the stack' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 598 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 599 | cmds_after_breakpoint=['py-down']) |
| 600 | self.assertEndsWith(bt, |
| 601 | 'Unable to find a newer python frame\n') |
| 602 | |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 603 | @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 604 | def test_up_at_top(self): |
| 605 | 'Verify handling of "py-up" at the top of the stack' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 606 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 607 | cmds_after_breakpoint=['py-up'] * 4) |
| 608 | self.assertEndsWith(bt, |
| 609 | 'Unable to find an older python frame\n') |
| 610 | |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 611 | @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 612 | def test_up_then_down(self): |
| 613 | 'Verify "py-up" followed by "py-down"' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 614 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 615 | cmds_after_breakpoint=['py-up', 'py-down']) |
| 616 | self.assertMultilineMatches(bt, |
| 617 | r'''^.* |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 618 | #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 619 | baz\(a, b, c\) |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 620 | #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 10, in baz \(args=\(1, 2, 3\)\) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 621 | print\(42\) |
| 622 | $''') |
| 623 | |
| 624 | class PyBtTests(DebuggerTests): |
| 625 | def test_basic_command(self): |
| 626 | 'Verify that the "py-bt" command works' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 627 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 628 | cmds_after_breakpoint=['py-bt']) |
| 629 | self.assertMultilineMatches(bt, |
| 630 | r'''^.* |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 631 | #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 632 | baz\(a, b, c\) |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 633 | #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 634 | bar\(a, b, c\) |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 635 | #[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\) |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 636 | foo\(1, 2, 3\) |
| 637 | ''') |
| 638 | |
| 639 | class PyPrintTests(DebuggerTests): |
| 640 | def test_basic_command(self): |
| 641 | 'Verify that the "py-print" command works' |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 642 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 643 | cmds_after_breakpoint=['py-print args']) |
| 644 | self.assertMultilineMatches(bt, |
| 645 | r".*\nlocal 'args' = \(1, 2, 3\)\n.*") |
| 646 | |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 647 | @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 648 | def test_print_after_up(self): |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 649 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 650 | cmds_after_breakpoint=['py-up', 'py-print c', 'py-print b', 'py-print a']) |
| 651 | self.assertMultilineMatches(bt, |
| 652 | r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*") |
| 653 | |
| 654 | def test_printing_global(self): |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 655 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 656 | cmds_after_breakpoint=['py-print __name__']) |
| 657 | self.assertMultilineMatches(bt, |
| 658 | r".*\nglobal '__name__' = '__main__'\n.*") |
| 659 | |
| 660 | def test_printing_builtin(self): |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 661 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 662 | cmds_after_breakpoint=['py-print len']) |
| 663 | self.assertMultilineMatches(bt, |
| 664 | r".*\nbuiltin 'len' = <built-in function len>\n.*") |
| 665 | |
| 666 | class PyLocalsTests(DebuggerTests): |
| 667 | def test_basic_command(self): |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 668 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 669 | cmds_after_breakpoint=['py-locals']) |
| 670 | self.assertMultilineMatches(bt, |
| 671 | r".*\nargs = \(1, 2, 3\)\n.*") |
| 672 | |
Victor Stinner | a92e81b | 2010-04-20 22:28:31 +0000 | [diff] [blame] | 673 | @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands") |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 674 | def test_locals_after_up(self): |
Martin v. Löwis | 24f09fd | 2010-04-17 22:40:40 +0000 | [diff] [blame] | 675 | bt = self.get_stack_trace(script=self.get_sample_script(), |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 676 | cmds_after_breakpoint=['py-up', 'py-locals']) |
| 677 | self.assertMultilineMatches(bt, |
| 678 | r".*\na = 1\nb = 2\nc = 3\n.*") |
| 679 | |
| 680 | def test_main(): |
Antoine Pitrou | 22db735 | 2010-07-08 18:54:04 +0000 | [diff] [blame] | 681 | cflags = sysconfig.get_config_vars()['PY_CFLAGS'] |
| 682 | final_opt = "" |
| 683 | for opt in cflags.split(): |
| 684 | if opt.startswith('-O'): |
| 685 | final_opt = opt |
| 686 | if final_opt and final_opt != '-O0': |
| 687 | raise unittest.SkipTest("Python was built with compiler optimizations, " |
| 688 | "tests can't reliably succeed") |
| 689 | |
Martin v. Löwis | 5a96543 | 2010-04-12 05:22:25 +0000 | [diff] [blame] | 690 | run_unittest(PrettyPrintTests, |
| 691 | PyListTests, |
| 692 | StackNavigationTests, |
| 693 | PyBtTests, |
| 694 | PyPrintTests, |
| 695 | PyLocalsTests |
Martin v. Löwis | bf0dfb3 | 2010-04-01 07:40:51 +0000 | [diff] [blame] | 696 | ) |
| 697 | |
| 698 | if __name__ == "__main__": |
| 699 | test_main() |