From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id B27BF3858C35; Tue, 27 Feb 2024 15:24:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B27BF3858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709047446; bh=LHU1oM8XgA/7us8Pn0FIlg+bP7xLQtKM6R/gALP+hsY=; h=From:To:Subject:Date:From; b=RmtqWTnQ/BOjPnNr7m3UArdhIMoXGLT6zEWGv/hfqe0Y/L/H8VVSNtev7OOJx+5az 1WFDnkd4X+/MBgiaDFB1XmJIRyLbm5iNtieRKp6YurYyXAQomQdujLMSrSG5fotQyJ H1XqKhmuHziOsiZyBd1avl6SD8DC9cS2jkVu617Y= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Reset errcnt and warncnt in default_gdb_init X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 0dbca2abb94778204b2c972bcca3855cdbf9afba X-Git-Newrev: 50c6682d74bb1b46ae3e140e107549733c699a44 Message-Id: <20240227152406.B27BF3858C35@sourceware.org> Date: Tue, 27 Feb 2024 15:24:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D50c6682d74bb= 1b46ae3e140e107549733c699a44 commit 50c6682d74bb1b46ae3e140e107549733c699a44 Author: Tom de Vries Date: Tue Feb 27 16:24:15 2024 +0100 [gdb/testsuite] Reset errcnt and warncnt in default_gdb_init =20 Say we do: ... $ make check RUNTESTFLAGS=3D"gdb.dap/ada-nested.exp gdb.dap/pause.exp" ... and add a perror at the end of pause.exp: ... dap_shutdown + +perror "foo" ... =20 We run into: ... UNRESOLVED: gdb.dap/ada-nested.exp: compilation prog.adb ... =20 This happens because the perror increases the errcnt, which is not rese= t at the end of the test-case, and consequently the first pass in the follow= ing test-case is changed into an unresolved. =20 Version 1.6.3 of dejagnu contains a fix which produces an unresolved at= the end of the test-case, which does reset the errcnt, but this is with ver= sion 1.6.1. =20 Furthermore, we reset the errcnt in clean_restart, but the pass is prod= uced before, so that doesn't help either. =20 Fix this by resetting errcnt and warncnt in default_gdb_init. =20 Tested on x86_64-linux. =20 Approved-By: Tom Tromey =20 PR testsuite/31351 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31351 Diff: --- gdb/testsuite/lib/gdb.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 7357d56f89a..fe4ac7d2719 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6859,6 +6859,15 @@ proc default_gdb_init { test_file_name } { return [uplevel 1 ::gdb_tcl_unknown $args] } } + + # Dejagnu version 1.6.3 and later produce an unresolved at the end of a + # testcase if an error triggered, resetting errcnt and warncnt to 0, in + # order to avoid errors in one test-case influencing the following + # test-case. Do this manually here, to support older versions. + global errcnt + global warncnt + set errcnt 0 + set warncnt 0 } =20 # Return a path using GDB_PARALLEL.