Add TUI test for "list"
authorTom Tromey <tom@tromey.com>
Sat, 20 Jul 2019 20:49:29 +0000 (14:49 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 28 Jul 2019 03:08:34 +0000 (21:08 -0600)
This adds a test to check that the "list" command will update the TUI
source window.

gdb/testsuite/ChangeLog
2019-07-27  Tom Tromey  <tom@tromey.com>

* gdb.tui/list.exp: New file.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.tui/list.exp [new file with mode: 0644]

index 3b3c1f5039e1e4b4cc73ce824762759c7c62098c..b43e635a0af87f59eee7e6e20d3baf87fbc20492 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-27  Tom Tromey  <tom@tromey.com>
+
+       * gdb.tui/list.exp: New file.
+
 2019-07-27  Tom Tromey  <tom@tromey.com>
 
        * gdb.tui/regs.exp: New file.
diff --git a/gdb/testsuite/gdb.tui/list.exp b/gdb/testsuite/gdb.tui/list.exp
new file mode 100644 (file)
index 0000000..6efe193
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright 2019 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Ensure that "list" will switch to the source view.
+
+load_lib "tuiterm.exp"
+
+standard_testfile tui-layout.c
+
+if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} {
+    return -1
+}
+
+Term::clean_restart 24 80 $testfile
+if {![Term::enter_tui]} {
+    unsupported "TUI not supported"
+}
+
+Term::check_contents "initial source listing" "No Source Available"
+
+Term::command "layout asm"
+Term::check_contents "asm window shows main" "$hex <main>"
+
+Term::command "list main"
+Term::check_contents "list main" "21 *return 0"
This page took 0.048968 seconds and 4 git commands to generate.