diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/style.c | 20 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/style.exp | 41 |
3 files changed, 66 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 951ad77..6b3ca5a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-12-28 Tom Tromey <tom@tromey.com> + * gdb.base/style.exp: New file. + * gdb.base/style.c: New file. + +2018-12-28 Tom Tromey <tom@tromey.com> + * lib/gdb.exp (gdb_init): Set the TERM environment variable to "dumb". * gdb.base/readline.exp (operate_and_get_next): Save and restore diff --git a/gdb/testsuite/gdb.base/style.c b/gdb/testsuite/gdb.base/style.c new file mode 100644 index 0000000..58fc243 --- /dev/null +++ b/gdb/testsuite/gdb.base/style.c @@ -0,0 +1,20 @@ +/* Copyright 2018 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/>. */ + +int +main (int argc, char **argv) +{ + return 0; /* break here */ +} diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp new file mode 100644 index 0000000..20b7b8c --- /dev/null +++ b/gdb/testsuite/gdb.base/style.exp @@ -0,0 +1,41 @@ +# Copyright 2018 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 CLI output styling. + +standard_testfile + +save_vars { env(TERM) } { + # We need an ANSI-capable terminal to get the output. + setenv TERM ansi + + if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { + return -1 + } + + if {![runto_main]} { + fail "style tests failed" + return + } + + gdb_test_no_output "set style enabled on" + + set main_expr "\033\\\[33mmain\033\\\[m" + set file_expr "\033\\\[32m.*style\\.c\033\\\[m:\[0-9\]" + + gdb_test "frame" \ + "$main_expr.*$file_expr.*" + gdb_test "info breakpoints" "$main_expr at $file_expr.*" +} |