]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.python/py-source-styling.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.python / py-source-styling.exp
1 # Copyright (C) 2022-2023 Free Software Foundation, Inc.
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
23 save_vars { env(TERM) } {
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.
28 setenv TERM ansi
29
30 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
31 return -1
32 }
33
34 if { [skip_python_tests] } { continue }
35
36 if { ![gdb_py_module_available "pygments"] } {
37 unsupported "pygments module not available"
38 return -1
39 }
40
41 if ![runto_main] {
42 return
43 }
44
45 gdb_test_no_output "maint set gnu-source-highlight enabled off"
46
47 gdb_test "maint flush source-cache" "Source cache flushed\\."
48
49 set seen_style_escape false
50 set line_number [gdb_get_line_number "List this line."]
51 gdb_test_multiple "list ${line_number}" "" {
52 -re "Python Exception.*" {
53 fail $gdb_test_name
54 }
55 -re "\033" {
56 set seen_style_escape true
57 exp_continue
58 }
59 -re "$gdb_prompt $" {
60 gdb_assert { $seen_style_escape }
61 pass $gdb_test_name
62 }
63 }
64 }