]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright (C) 2022-2024 Free Software Foundation, Inc. |
299953ca AB |
2 | |
3 | # This program is free software; you can redistribute it and/or modify | |
4 | # it under the terms of the GNU General Public License as published by | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
13 | # You should have received a copy of the GNU General Public License | |
14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | ||
16 | # This file is part of the GDB testsuite. It checks for memory leaks | |
17 | # associated with allocating and deallocation gdb.Inferior objects. | |
18 | ||
19 | load_lib gdb-python.exp | |
20 | ||
21 | standard_testfile | |
22 | ||
4ebfd53d | 23 | with_ansi_styling_terminal { |
299953ca AB |
24 | # We need an ANSI-capable terminal to get the output, additionally |
25 | # we need to set LC_ALL so GDB knows the terminal is UTF-8 | |
26 | # capable, otherwise we'll get a UnicodeEncodeError trying to | |
27 | # encode the output. | |
299953ca AB |
28 | if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { |
29 | return -1 | |
30 | } | |
31 | ||
d82e5429 | 32 | if { ![allow_python_tests] } { continue } |
299953ca AB |
33 | |
34 | if { ![gdb_py_module_available "pygments"] } { | |
35 | unsupported "pygments module not available" | |
36 | return -1 | |
37 | } | |
38 | ||
39 | if ![runto_main] { | |
40 | return | |
41 | } | |
42 | ||
43 | gdb_test_no_output "maint set gnu-source-highlight enabled off" | |
44 | ||
45 | gdb_test "maint flush source-cache" "Source cache flushed\\." | |
46 | ||
47 | set seen_style_escape false | |
48 | set line_number [gdb_get_line_number "List this line."] | |
49 | gdb_test_multiple "list ${line_number}" "" { | |
50 | -re "Python Exception.*" { | |
51 | fail $gdb_test_name | |
52 | } | |
53 | -re "\033" { | |
54 | set seen_style_escape true | |
55 | exp_continue | |
56 | } | |
57 | -re "$gdb_prompt $" { | |
58 | gdb_assert { $seen_style_escape } | |
59 | pass $gdb_test_name | |
60 | } | |
61 | } | |
62 | } |