aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.tui/new-layout.exp54
2 files changed, 58 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d3f555e..c7270b9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2020-02-22 Tom Tromey <tom@tromey.com>
+ * gdb.tui/new-layout.exp: New file.
+
+2020-02-22 Tom Tromey <tom@tromey.com>
+
* gdb.rust/rust-style.rs: New file.
* gdb.rust/rust-style.exp: New file.
* gdb.base/style.exp: Test structure printing.
diff --git a/gdb/testsuite/gdb.tui/new-layout.exp b/gdb/testsuite/gdb.tui/new-layout.exp
new file mode 100644
index 0000000..2efc172
--- /dev/null
+++ b/gdb/testsuite/gdb.tui/new-layout.exp
@@ -0,0 +1,54 @@
+# Copyright 2020 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/>.
+
+# Test "tui new-layout".
+
+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
+
+gdb_test "tui new-layout" \
+ "No layout name specified"
+gdb_test "tui new-layout example" \
+ "New layout does not contain any windows"
+gdb_test "tui new-layout example zzq" \
+ "Unknown window \"zzq\""
+gdb_test "tui new-layout example src 1 src 1" \
+ "Window \"src\" seen twice in layout"
+gdb_test "tui new-layout example src 1" \
+ "New layout does not contain the \"cmd\" window"
+
+gdb_test_no_output "tui new-layout example asm 1 status 0 cmd 1"
+
+gdb_test "help layout example" \
+ "Apply the \"example\" layout.*tui new-layout example asm 1 status 0 cmd 1"
+
+if {![Term::enter_tui]} {
+ unsupported "TUI not supported"
+}
+
+set text [Term::get_all_lines]
+gdb_assert {![string match "No Source Available" $text]} \
+ "initial source listing"
+
+Term::command "layout example"
+Term::check_contents "example layout shows assembly" \
+ "No Assembly Available"