From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB79F3858D33; Thu, 2 Mar 2023 08:47:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB79F3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677746841; bh=OERtYAPpxFhwQv7qtx36WvngGPwGqaplRSqYAFTNfyk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BX90CCRAuulnCUSz2PjnSDGFPfGbaEpC85mNeUxNBvpi5eWcnSCjsNeYZmnI30dX7 XtKOMhhCgZIh+2Mc2Pg1UbhD4vwL2iOXhDjm/RdvNEFL6aB1qORfceC1B0vSZgX62i WMRyaasUqu/NbzkT4AhqnbRGeKfXVvvEULx+vNQk= From: "jakub 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: Thu, 02 Mar 2023 08:47:21 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Wrapping tests individually for each possible $COLUMNS case would be a maintainance nightmare, e.g. trying to make it work with COLUNMS in [30, 41] inclusive means: --- gcc/diagnostic-show-locus.cc.jj 2023-01-02 09:32:39.783033909 +0100 +++ gcc/diagnostic-show-locus.cc 2023-03-02 09:45:42.432403239 +0100 @@ -4436,7 +4436,7 @@ test_add_location_if_nearby (const line_ /* Test of add_location_if_nearby on the same line as the primary location. */ - { + if (get_terminal_width () > 41) { const location_t missing_close_brace_1_39 =3D linemap_position_for_line_and_column (line_table, ord_map, 1, 39= ); const location_t matching_open_brace_1_18 @@ -4501,7 +4501,7 @@ test_diagnostic_show_locus_fixit_lines ( /* A pair of tests for modernizing the initializers to C99-style. */ /* The one-liner case (line 2). */ - { + if (get_terminal_width () > 31) { test_diagnostic_context dc; const location_t x =3D linemap_position_for_line_and_column (line_table, ord_map, 2, 24= ); @@ -4521,7 +4521,7 @@ test_diagnostic_show_locus_fixit_lines ( verify that insertion fixit on line 3 is still printed (and that span starts are printed due to the gap between the span at line 3 and that at line 6). */ - { + if (get_terminal_width () > 34) { test_diagnostic_context dc; const location_t y =3D linemap_position_for_line_and_column (line_table, ord_map, 3, 24= ); @@ -4543,7 +4543,7 @@ test_diagnostic_show_locus_fixit_lines ( /* As above, but verify the behavior of multiple line spans with line-numbering enabled. */ - { + if (get_terminal_width () > 40) { const location_t y =3D linemap_position_for_line_and_column (line_table, ord_map, 3, 24= ); const location_t colon @@ -4756,7 +4756,7 @@ test_overlapped_fixit_printing (const li but for which the *printing* may need consolidation. */ /* Example where 3 fix-it hints are printed as one. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_replace (open_paren, "const_cast<"); @@ -4826,7 +4826,7 @@ test_overlapped_fixit_printing (const li } /* Example where two are consolidated during printing. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_replace (open_paren, "CAST ("); @@ -4843,7 +4843,7 @@ test_overlapped_fixit_printing (const li } /* Example where none are consolidated during printing. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_replace (open_paren, "CST ("); @@ -4860,7 +4860,7 @@ test_overlapped_fixit_printing (const li } /* Example of deletion fix-it hints. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_insert_before (open_paren, "(bar *)"); @@ -4880,7 +4880,7 @@ test_overlapped_fixit_printing (const li } /* Example of deletion fix-it hints that would overlap. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_insert_before (open_paren, "(longer *)"); @@ -4900,7 +4900,7 @@ test_overlapped_fixit_printing (const li } /* Example of insertion fix-it hints that would overlap. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_insert_before (open_paren, "LONGER THAN THE CAST"); @@ -4967,7 +4967,7 @@ test_overlapped_fixit_printing_utf8 (con but for which the *printing* may need consolidation. */ /* Example where 3 fix-it hints are printed as one. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_replace (open_paren, "const_cast<"); @@ -5043,7 +5043,7 @@ test_overlapped_fixit_printing_utf8 (con } /* Example where two are consolidated during printing. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_replace (open_paren, "CAST ("); @@ -5063,7 +5063,7 @@ test_overlapped_fixit_printing_utf8 (con } /* Example where none are consolidated during printing. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_replace (open_paren, "CST ("); @@ -5083,7 +5083,7 @@ test_overlapped_fixit_printing_utf8 (con } /* Example of deletion fix-it hints. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_insert_before (open_paren, "(bar\xf0\x9f\x98\x82 *)"= ); @@ -5107,7 +5107,7 @@ test_overlapped_fixit_printing_utf8 (con } /* Example of deletion fix-it hints that would overlap. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_insert_before (open_paren, "(long\xf0\x9f\x98\x82 *)= "); @@ -5132,7 +5132,7 @@ test_overlapped_fixit_printing_utf8 (con } /* Example of insertion fix-it hints that would overlap. */ - { + if (get_terminal_width () > 30) { test_diagnostic_context dc; rich_location richloc (line_table, expr); richloc.add_fixit_insert_before @@ -5514,7 +5514,7 @@ test_tab_expansion (const line_table_cas /* Confirm the display width was tracked correctly across the internal t= ab as well. */ - { + if (get_terminal_width () > 36) { test_diagnostic_context dc; dc.tabstop =3D tabstop; rich_location richloc (line_table,=