From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 1A0AD385783F; Wed, 25 Jan 2023 11:27:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A0AD385783F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674646037; bh=TVHRyGYdycrWAim7CnhiXc6RJo8M/ERenKmFZ7b/z+8=; h=From:To:Subject:Date:From; b=shFMm/yPXakLZTW+lCrxk1F3Fr0MVOaI+pg1BmJbNmUTr0jWFPvDll1UFp3Nv3zZL inl3KzVbeXfESHY7o+X8O9qVOzsAYmcvZrrIFMCmomQRpu6scgAvF1f3FG1S/HakS9 115AHX01fyPVI4BQ0Slr7ydvUtxmyvWQc50y/5K8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: update gdb.tui/tui-nl-filtered-output.exp X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 843a1a4f735e77147710b307db29a1b5f4e1c707 X-Git-Newrev: 3602634035f6a346ac043a7f01442a7290b9f588 Message-Id: <20230125112717.1A0AD385783F@sourceware.org> Date: Wed, 25 Jan 2023 11:27:17 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3602634035f6= a346ac043a7f01442a7290b9f588 commit 3602634035f6a346ac043a7f01442a7290b9f588 Author: Andrew Burgess Date: Thu Dec 22 10:24:22 2022 +0000 gdb/testsuite: update gdb.tui/tui-nl-filtered-output.exp =20 Following on from the previous commit, in this commit I am updating the test script gdb.tui/tui-nl-filtered-output.exp to take account of the changes in commit: =20 commit 9162a27c5f5828240b53379d735679e2a69a9f41 Date: Tue Nov 13 11:59:03 2018 -0700 =20 Change gdb test suite's TERM setting =20 In the above commit the TERM environment variable was changed to be 'dumb' by default, which means that tests, that previously activated tui mode, no longer do unless TERM is set to 'ansi'. =20 As the gdb.tui/tui-nl-filtered-output.exp script didn't do this, the test stopped working. As the expect patterns in this script were pretty generic no tests actually started failing, and we never noticed. =20 In this commit I update the test script to correctly activate our terminal emulator, the test continues to pass after this update, but now we are testing in tui mode. Diff: --- gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp | 37 ++++++++++----------= ---- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp b/gdb/testsui= te/gdb.tui/tui-nl-filtered-output.exp index b7ea67cf723..5b1d6b7d9ba 100644 --- a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp +++ b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp @@ -32,24 +32,19 @@ =20 require allow_tui_tests =20 -gdb_exit -gdb_start - -# Enable the TUI. - -set test "tui enable" -gdb_test_multiple "tui enable" $test { - -re "$gdb_prompt $" { - pass $test - } -} - -# Make sure filtering/pagination is enabled, but make the window high -# enough that we don't paginate in practice. -gdb_test_no_output "set pagination on" -gdb_test_no_output "set height 2000" - -gdb_test \ - {printf "hello\nworld\n"} \ - "hello\r\nworld" \ - "correct line breaks" +tuiterm_env + +# Setup and enter TUI mode. +Term::clean_restart 24 80 +Term::enter_tui + +# Send the command, and check the output is correctly split over +# multiple lines. +Term::command \ + {printf "hello\nworld\n"} +Term::check_region_contents "check printf output" \ + 0 16 80 4 [multi_line \ + "$gdb_prompt printf \"hello\\\\nworld\\\\n\"\\s+" \ + "hello\\s+" \ + "world\\s+" \ + "$gdb_prompt\\s+"]