From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 24C193858413; Sat, 4 Mar 2023 08:49:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24C193858413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677919772; bh=kCN7reUOrKwxWZmniuxqTPoQvWKCeosuOOAC8hhK8jg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rUt3MgabhzRPu4dAxFwNHPCtmzrx5O8uYQycIdlBy1Kcy/e+GLCk+QMN6R2Q9CqCm gE4AObg/SnB8v5ZWMLmi4bxSyTjzGRPLG+qxpkkyQTew2tuTzC67E0PUKIBrh3W79I Puh7O6ov3e6icyy7xpT/wwgpJNkgnYzem2Cgya3E= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/108973] [13 Regression] Sufficiently narrow terminal window causes selftest failure Date: Sat, 04 Mar 2023 08:49:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: build, diagnostic, ice-on-valid-code, internal-improvement X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108973 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:739e7ebb3d378ece25d64b39baae47c584253498 commit r13-6472-g739e7ebb3d378ece25d64b39baae47c584253498 Author: Jakub Jelinek Date: Sat Mar 4 09:48:17 2023 +0100 diagnostics: Fix up selftests with $COLUMNS < 42 [PR108973] As mentioned in the PR, GCC's diagnostics self-tests fail if $COLUMNS <= 42. Guarding each self-test with if (get_terminal_width () > 41) or similar would be a maintainance nightmare (PR has a patch to do so without reformatting to make it work for $COLUMNS in [30, 41] inclusive, but I'm afraid going down to $COLUMNS 1 would mean marking everything). Furthermore, the self-tests don't really emit stuff to the terminal, but into a buffer, so using get_terminal_width () for it seems inappropriate. The following patch makes sure test_diagnostic_context constructor uses exactly 80 columns wide caret max width, of course some tests override it already if they want to test for behavior in narrower cases. 2023-03-04 Jakub Jelinek PR testsuite/108973 * selftest-diagnostic.cc (test_diagnostic_context::test_diagnostic_context): Set caret_max_width to 80.=