diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/tui-layout.exp | 7 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 16 |
3 files changed, 28 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a74ac524d2c..3a947eb4fe0 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-20 Andrew Burgess <andrew.burgess@embecosm.com> + + * lib/gdb.exp (skip_tui_tests): New proc. + * gdb.base/tui-layout.exp: Check skip_tui_tests. + 2015-05-19 Pedro Alves <palves@redhat.com> * gdb.base/gdbinit-history.exp (test_gdbinit_history_setting): diff --git a/gdb/testsuite/gdb.base/tui-layout.exp b/gdb/testsuite/gdb.base/tui-layout.exp index 0dcf1cac564..cac2bc95567 100644 --- a/gdb/testsuite/gdb.base/tui-layout.exp +++ b/gdb/testsuite/gdb.base/tui-layout.exp @@ -19,4 +19,11 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } { return -1 } +if {[skip_tui_tests]} { + # TUI support is disabled. Check for error message. + gdb_test "layout asm" "Undefined command: \"layout\". Try \"help\"." + return +} + +# Just check the command does not cause gdb to crash. gdb_test "layout asm" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 73e55e3ea1f..089a10c3c26 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1727,6 +1727,22 @@ proc skip_shlib_tests {} { return 1 } +# Return 1 if we should skip tui related tests. + +proc skip_tui_tests {} { + global gdb_prompt + + gdb_test_multiple "help layout" "verify tui support" { + -re "Undefined command: \"layout\".*$gdb_prompt $" { + return 1 + } + -re "$gdb_prompt $" { + } + } + + return 0 +} + # Test files shall make sure all the test result lines in gdb.sum are # unique in a test run, so that comparing the gdb.sum files of two # test runs gives correct results. Test files that exercise |