From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uNHGGMVRXGErGQAAWB0awg (envelope-from ) for ; Tue, 05 Oct 2021 09:23:17 -0400 Received: by simark.ca (Postfix, from userid 112) id 6379C1EE1B; Tue, 5 Oct 2021 09:23:17 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A04EF1E813 for ; Tue, 5 Oct 2021 09:23:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3AF613857029 for ; Tue, 5 Oct 2021 13:23:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3AF613857029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633440196; bh=0em7m6ti6yhTGZbPq4j30qDE5U/1mtfP68Cr/ApGo6o=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=b1fX8z9eLgaiu8Y2l69yQdxRwxx1aLLSGEEt/F3tVLnkgFSebFASUhGmeUivO2F3i UpxPTXJZJsij3u5meENCsSRYe6HQ7kih5BR31FHcgFtbokzVUbyWzSLrU/uRqG11H7 NIxb/h+VVTKrnxDpyVeYnBYJo0XEFMEpGVcZJXsw= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 7729C385840B for ; Tue, 5 Oct 2021 13:22:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7729C385840B Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9849822399; Tue, 5 Oct 2021 13:22:56 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 661DB13C6B; Tue, 5 Oct 2021 13:22:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fnBRF7BRXGH8CQAAMHmgww (envelope-from ); Tue, 05 Oct 2021 13:22:56 +0000 Date: Tue, 5 Oct 2021 15:22:54 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Make tui testing less verbose Message-ID: <20211005132252.GA19305@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, Currently, tui testing is rather verbose. When using these RUNTESTFLAGS to pick up all tui tests (17 in total): ... rtf=$(echo $(cd src/gdb/testsuite/; find gdb.* -type f -name *.exp* \ | xargs grep -l tuiterm_env) ) ... we have: ... $ wc -l gdb.log 120592 gdb.log ... Most of the output is related to controlling the tui screen, but that does not give a top-level sense of how the test-case progresses. Put differently: a lot of bandwith is used to describe how we arrive at a certain tui screen state. But we don't actually always show the state we arrive at, unless there's a FAIL. And if there's say, a PASS that should actually be FAILing, it's hard to detect. Fix this by: - dropping the -log on the call to verbose in _log. We still can get the same info back using runtest -v. - dumping the screen or box that we're checking, also when the test passes. Brings down verbosity to something more reasonable: ... $ wc -l gdb.log 3221 gdb.log ... Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Make tui testing less verbose --- gdb/testsuite/lib/tuiterm.exp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index a0197402b1f..149b7515d49 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -34,7 +34,7 @@ namespace eval Term { variable _resize_count proc _log { what } { - verbose -log "+++ $what" + verbose "+++ $what" } # Call BODY, then log WHAT along with the original and new cursor position. @@ -754,11 +754,11 @@ namespace eval Term { # Check for a box at the given coordinates. proc check_box {test_name x y width height} { + dump_box $x $y $width $height set why [_check_box $x $y $width $height] if {$why == ""} { pass $test_name } else { - dump_screen fail "$test_name ($why)" } } @@ -766,10 +766,9 @@ namespace eval Term { # Check whether the text contents of the terminal match the # regular expression. Note that text styling is not considered. proc check_contents {test_name regexp} { + dump_screen set contents [get_all_lines] - if {![gdb_assert {[regexp -- $regexp $contents]} $test_name]} { - dump_screen - } + gdb_assert {[regexp -- $regexp $contents]} $test_name } # Get the region of the screen described by X, Y, WIDTH, @@ -800,13 +799,12 @@ namespace eval Term { # choice for boxes with a border). proc check_region_contents { test_name x y width height regexp } { variable _chars + dump_box $x $y $width $height # Now grab the contents of the box, join each line together # with a '\r\n' sequence and match against REGEXP. set result [get_region $x $y $width $height "\r\n"] - if {![gdb_assert {[regexp -- $regexp $result]} $test_name]} { - dump_screen - } + gdb_assert {[regexp -- $regexp $result]} $test_name } # Check the contents of a box on the screen. This is a little @@ -818,9 +816,9 @@ namespace eval Term { proc check_box_contents {test_name x y width height regexp} { variable _chars + dump_box $x $y $width $height set why [_check_box $x $y $width $height] if {$why != ""} { - dump_screen fail "$test_name (box check: $why)" return }