From patchwork Tue Feb 27 09:07:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 86422 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B023385843B for ; Tue, 27 Feb 2024 09:07:35 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 6BA3F3858D38 for ; Tue, 27 Feb 2024 09:06:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6BA3F3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6BA3F3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709024828; cv=none; b=TR4SCCdSr2VNSzeuPDSez6Tj8f+uBIlFI3VEFt1Yg6Rc92WAYwVf0BgO8qyt1mo4m/6TOTr5BY30E1VLEN1+kmuo2A3PpsB/PL0xKjzdEn3CO8Cj9utFhKZpS+lMy5zW0rtK8Og3uwaS1WjNCeJVMWUGAF08YFRbMmDRk/V27F0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709024828; c=relaxed/simple; bh=EpkMDCmEbTFZeq1y0iokklQzd9dd8xt2tTRWDJkmcUA=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=j0A7dxGdo3Ahy6+50+0PFEnqc9aSidzuVZ80VOesvBEE9GEsqyQlzynXGQJA+UBsmr6+GhzP76x9tu9qLekMJcdKalsH2VzKoDGSgIlI9w8o2TbkwtmDhKIB96XidLv20LSN7lZZScklayux1mlpvANiPsco8DVcZDiUPaKK1jw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6342C1F449 for ; Tue, 27 Feb 2024 09:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709024818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=exnMGc5n2Qyx5mUCf4cpWHff9HcY8EnqCeGRTlsKMPI=; b=FuMyUmiv91k4mgJIv/T4JqTfc6zCpElGh9Ajg2NHj/KbVzrfdtIPG3nc7D+vysYX81OgJ1 9y9hvtv5hsbZPssAy2fNudVkGBI1CcfdHMdKEkEGUt7qX5UYvjqHGs7GIcvUeqpXa+P3ZF v9hSSSihViVk9zfyqmNevPqxfV/L80I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709024818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=exnMGc5n2Qyx5mUCf4cpWHff9HcY8EnqCeGRTlsKMPI=; b=9bi9ftJ03DD4NOytQiFhWqcq2nHn2e65QHFhah/YxR7VNs0+FsA9XiZ6GwNO7LqAF4diLY T40gaRv7tsGCbAAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709024818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=exnMGc5n2Qyx5mUCf4cpWHff9HcY8EnqCeGRTlsKMPI=; b=FuMyUmiv91k4mgJIv/T4JqTfc6zCpElGh9Ajg2NHj/KbVzrfdtIPG3nc7D+vysYX81OgJ1 9y9hvtv5hsbZPssAy2fNudVkGBI1CcfdHMdKEkEGUt7qX5UYvjqHGs7GIcvUeqpXa+P3ZF v9hSSSihViVk9zfyqmNevPqxfV/L80I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709024818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=exnMGc5n2Qyx5mUCf4cpWHff9HcY8EnqCeGRTlsKMPI=; b=9bi9ftJ03DD4NOytQiFhWqcq2nHn2e65QHFhah/YxR7VNs0+FsA9XiZ6GwNO7LqAF4diLY T40gaRv7tsGCbAAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4491D13A58 for ; Tue, 27 Feb 2024 09:06:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 78ZhDzKm3WUwbQAAD6G6ig (envelope-from ) for ; Tue, 27 Feb 2024 09:06:58 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Reset errcnt and warncnt in default_gdb_init Date: Tue, 27 Feb 2024 10:07:09 +0100 Message-Id: <20240227090709.3330-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=FuMyUmiv; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=9bi9ftJ0 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-2.44 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; DWL_DNSWL_HI(-3.50)[suse.de:dkim]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,sourceware.org:url]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.43)[97.40%] X-Spam-Score: -2.44 X-Rspamd-Queue-Id: 6342C1F449 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Say we do: ... $ make check RUNTESTFLAGS="gdb.dap/ada-nested.exp gdb.dap/pause.exp" ... and add a perror at the end of pause.exp: ... dap_shutdown + +perror "foo" ... We run into: ... UNRESOLVED: gdb.dap/ada-nested.exp: compilation prog.adb ... This happens because the perror increases the errcnt, which is not reset at the end of the test-case, and consequently the first pass in the following test-case is changed into an unresolved. 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 version 1.6.1. Furthermore, we reset the errcnt in clean_restart, but the pass is produced before, so that doesn't help either. Fix this by resetting errcnt and warncnt in default_gdb_init. Tested on x86_64-linux. PR testsuite/31351 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31351 --- gdb/testsuite/lib/gdb.exp | 9 +++++++++ 1 file changed, 9 insertions(+) base-commit: 268391acb9fa956bad24533e2cc0d1459dea1b3d 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 } # Return a path using GDB_PARALLEL.