]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.tui/main.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.tui / main.exp
CommitLineData
1d506c26 1# Copyright 2019-2024 Free Software Foundation, Inc.
52b75bf1
TT
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# Test that "file" shows "main".
17
1b05f108
TV
18require allow_tui_tests
19
8c74a764 20tuiterm_env
52b75bf1
TT
21
22standard_testfile tui-layout.c
23
24if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
25 return -1
26}
27
28# Note: don't pass the executable here
29Term::clean_restart 24 80
30
aa2306fb
TV
31set line " return 0;"
32set nr [gdb_get_line_number $line]
33
4f13c1c0
TT
34# Later on we'd like to avoid having to answer a question.
35gdb_test_no_output "set interactive-mode off"
36
aa2306fb
TV
37# Show the left margin using tui-left-margin-verbose.
38gdb_test_no_output "maint set tui-left-margin-verbose on"
39
52b75bf1
TT
40if {![Term::enter_tui]} {
41 unsupported "TUI not supported"
581bea2c 42 return
52b75bf1
TT
43}
44
f3561393
TV
45send_gdb "file [standard_output_file $testfile]\n"
46gdb_assert { [Term::wait_for "Reading symbols from"] } "file command"
aa2306fb
TV
47Term::check_contents "show main after file" \
48 [string_to_regexp "|___[format %06d $nr]_$line"]
4f13c1c0
TT
49
50# Ensure that "file" clears the source window.
51Term::command "file"
52Term::check_contents "file clears window" "No Source Available"