public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure
@ 2023-02-28 17:12 acoplan at gcc dot gnu.org
  2023-03-01 21:21 ` [Bug testsuite/108973] " pinskia at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-02-28 17:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

            Bug ID: 108973
           Summary: Sufficiently narrow terminal window causes selftest
                    failure
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

Running the selftests in a sufficiently-narrow terminal window (in my case
$COLUMNS < 42) causes the following selftest failure:

$ echo $COLUMNS
41
$ ./xgcc -B . -c -xc /dev/null
-fself-test=$HOME/toolchain/src/gcc/gcc/testsuite/selftests
/home/alecop01/toolchain/src/gcc/gcc/diagnostic-show-locus.cc:4452:
test_add_location_if_nearby: FAIL: ASSERT_STREQ (" struct same_line { double x;
double y; ;\n" "                  ~                    ^\n", pp_formatted_text
(dc.printer))
 val1=" struct same_line { double x; double y; ;
                  ~                    ^
"
 val2=" truct same_line { double x; double y; ;
                 ~                    ^

"

cc1: internal compiler error: in fail_formatted, at selftest.cc:63
0x2b02675 selftest::fail_formatted(selftest::location const&, char const*, ...)
        /home/alecop01/toolchain/src/gcc/gcc/selftest.cc:63
0x2b02764 selftest::assert_streq(selftest::location const&, char const*, char
const*, char const*, char const*)
        /home/alecop01/toolchain/src/gcc/gcc/selftest.cc:92
0x2b24547 test_add_location_if_nearby
        /home/alecop01/toolchain/src/gcc/gcc/diagnostic-show-locus.cc:4450
0x2b51737 selftest::for_each_line_table_case(void (*)(selftest::line_table_case
const&))
        /home/alecop01/toolchain/src/gcc/gcc/input.cc:3899
0x2b2bf52 selftest::diagnostic_show_locus_cc_tests()
        /home/alecop01/toolchain/src/gcc/gcc/diagnostic-show-locus.cc:5706
0x29c8f24 selftest::run_tests()
        /home/alecop01/toolchain/src/gcc/gcc/selftest-run-tests.cc:96
0x15d19c4 toplev::run_self_tests()
        /home/alecop01/toolchain/src/gcc/gcc/toplev.cc:2184
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
@ 2023-03-01 21:21 ` pinskia at gcc dot gnu.org
  2023-03-01 21:22 ` [Bug testsuite/108973] [13 Regression] " pinskia at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 21:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic,
                   |                            |ice-on-valid-code,
                   |                            |internal-improvement
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-03-01
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
selftests should be as indepedent from the environment variables as much as it
can be ...

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [13 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
  2023-03-01 21:21 ` [Bug testsuite/108973] " pinskia at gcc dot gnu.org
@ 2023-03-01 21:22 ` pinskia at gcc dot gnu.org
  2023-03-02  8:47 ` jakub at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-01 21:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Sufficiently narrow         |[13 Regression]
                   |terminal window causes      |Sufficiently narrow
                   |selftest failure            |terminal window causes
                   |                            |selftest failure
   Target Milestone|---                         |13.0

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is a regression since selftests are newish but I don't know which releases
are broken though.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [13 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
  2023-03-01 21:21 ` [Bug testsuite/108973] " pinskia at gcc dot gnu.org
  2023-03-01 21:22 ` [Bug testsuite/108973] [13 Regression] " pinskia at gcc dot gnu.org
@ 2023-03-02  8:47 ` jakub at gcc dot gnu.org
  2023-03-02  9:10 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-02  8:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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
       = 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
       = 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
       = 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
       = 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 tab
      as well.  */
-  {
+  if (get_terminal_width () > 36) {
     test_diagnostic_context dc;
     dc.tabstop = tabstop;
     rich_location richloc (line_table,

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [13 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-03-02  8:47 ` jakub at gcc dot gnu.org
@ 2023-03-02  9:10 ` jakub at gcc dot gnu.org
  2023-03-02 15:23 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-02  9:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54568
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54568&action=edit
gcc13-pr108973.patch

So, I think we should just make sure test_diagnostic_context has reasonable
caret_max_width...

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [13 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-03-02  9:10 ` jakub at gcc dot gnu.org
@ 2023-03-02 15:23 ` marxin at gcc dot gnu.org
  2023-03-04  8:49 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-02 15:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
What a funny selftest failure!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [13 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-03-02 15:23 ` marxin at gcc dot gnu.org
@ 2023-03-04  8:49 ` cvs-commit at gcc dot gnu.org
  2023-03-04  9:29 ` [Bug testsuite/108973] [10/11/12 " jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-04  8:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:739e7ebb3d378ece25d64b39baae47c584253498

commit r13-6472-g739e7ebb3d378ece25d64b39baae47c584253498
Author: Jakub Jelinek <jakub@redhat.com>
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  <jakub@redhat.com>

            PR testsuite/108973
            * selftest-diagnostic.cc
            (test_diagnostic_context::test_diagnostic_context): Set
            caret_max_width to 80.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10/11/12 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-03-04  8:49 ` cvs-commit at gcc dot gnu.org
@ 2023-03-04  9:29 ` jakub at gcc dot gnu.org
  2023-03-19  5:30 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-04  9:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13 Regression]             |[10/11/12 Regression]
                   |Sufficiently narrow         |Sufficiently narrow
                   |terminal window causes      |terminal window causes
                   |selftest failure            |selftest failure
   Target Milestone|13.0                        |10.5

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.  Just tried 10 branch and it ICEs in self-tests with
COLUMNS=41 as well:
$ ./xgcc -B ./ -v
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --disable-bootstrap --enable-checking=yes
--enable-languages=c,c++,fortran : (reconfigured) 
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.4.1 20220628 (GCC) 
$ COLUMNS=41 ./xgcc -B./ -B/usr/local/x86_64-pc-linux-gnu/bin/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -L/usr/src/gcc-10/obj/gcc/../ld -xc
-nostdinc /dev/null -S -o /dev/null -fself-test=../../gcc/testsuite/selftests
../../gcc/diagnostic-show-locus.c:3949: test_add_location_if_nearby: FAIL:
ASSERT_STREQ (" struct same_line { double x; double y; ;\n" "                 
~                    ^\n", pp_formatted_text (dc.printer)) val1=" struct
same_line { double x; double y; ;
                  ~                    ^
" val2=" truct same_line { double x; double y; ;
                 ~                    ^

"
cc1: internal compiler error: in fail_formatted, at selftest.c:63
0x21a3a86 diagnostic_impl
        ../../gcc/selftest.h:1309
0x21a541a internal_error(char const*, ...)
        ../../gcc/selftest.h:1711
0x21a5678 fancy_abort(char const*, int, char const*)
        ../../gcc/selftest.h:1778
0x219d50b selftest::fail_formatted(selftest::location const&, char const*, ...)
        ../../gcc/selftest.h:63
0x219d5fa selftest::assert_streq(selftest::location const&, char const*, char
const*, char const*, char const*)
        ../../gcc/selftest.h:92
0x21b2fb6 test_add_location_if_nearby
        ../../gcc/../libcpp/include/cpplib.h:3949
0x21dd17a selftest::for_each_line_table_case(void (*)(selftest::line_table_case
const&))
        ../../gcc/../libcpp/include/cpplib.h:3573
0x21b95ea selftest::diagnostic_show_locus_c_tests()
        ../../gcc/../libcpp/include/cpplib.h:5022
0x20d83f9 selftest::run_tests()
        ../../gcc/wide-int-bitmask.h:96
0x11ae133 toplev::run_self_tests()
        ../../gcc/flags.h:2351
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10/11/12 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-03-04  9:29 ` [Bug testsuite/108973] [10/11/12 " jakub at gcc dot gnu.org
@ 2023-03-19  5:30 ` cvs-commit at gcc dot gnu.org
  2023-03-20 10:29 ` [Bug testsuite/108973] [10/11 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-19  5:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:643985d91512fb8762623034d36d3f48a8b1c282

commit r12-9284-g643985d91512fb8762623034d36d3f48a8b1c282
Author: Jakub Jelinek <jakub@redhat.com>
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  <jakub@redhat.com>

            PR testsuite/108973
            * selftest-diagnostic.cc
            (test_diagnostic_context::test_diagnostic_context): Set
            caret_max_width to 80.

    (cherry picked from commit 739e7ebb3d378ece25d64b39baae47c584253498)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10/11 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-03-19  5:30 ` cvs-commit at gcc dot gnu.org
@ 2023-03-20 10:29 ` jakub at gcc dot gnu.org
  2023-05-02 20:15 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-03-20 10:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12 Regression]       |[10/11 Regression]
                   |Sufficiently narrow         |Sufficiently narrow
                   |terminal window causes      |terminal window causes
                   |selftest failure            |selftest failure

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 12.3 too.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10/11 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-03-20 10:29 ` [Bug testsuite/108973] [10/11 " jakub at gcc dot gnu.org
@ 2023-05-02 20:15 ` cvs-commit at gcc dot gnu.org
  2023-05-03 10:42 ` [Bug testsuite/108973] [10 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-02 20:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:8b564ac2db506189c87b2871d9fc0fb994b809a5

commit r11-10720-g8b564ac2db506189c87b2871d9fc0fb994b809a5
Author: Jakub Jelinek <jakub@redhat.com>
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  <jakub@redhat.com>

            PR testsuite/108973
            * selftest-diagnostic.c
            (test_diagnostic_context::test_diagnostic_context): Set
            caret_max_width to 80.

    (cherry picked from commit 739e7ebb3d378ece25d64b39baae47c584253498)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-05-02 20:15 ` cvs-commit at gcc dot gnu.org
@ 2023-05-03 10:42 ` jakub at gcc dot gnu.org
  2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
  2023-05-04  7:25 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-03 10:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11 Regression]          |[10 Regression]
                   |Sufficiently narrow         |Sufficiently narrow
                   |terminal window causes      |terminal window causes
                   |selftest failure            |selftest failure

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 11.4 as well.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-05-03 10:42 ` [Bug testsuite/108973] [10 " jakub at gcc dot gnu.org
@ 2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
  2023-05-04  7:25 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:880fc42b29d1f1d076ddb1953bad4d9a67df2b1a

commit r10-11373-g880fc42b29d1f1d076ddb1953bad4d9a67df2b1a
Author: Jakub Jelinek <jakub@redhat.com>
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  <jakub@redhat.com>

            PR testsuite/108973
            * selftest-diagnostic.c
            (test_diagnostic_context::test_diagnostic_context): Set
            caret_max_width to 80.

    (cherry picked from commit 739e7ebb3d378ece25d64b39baae47c584253498)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug testsuite/108973] [10 Regression] Sufficiently narrow terminal window causes selftest failure
  2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
@ 2023-05-04  7:25 ` jakub at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-04  7:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108973

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 10.5 too.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-04  7:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 17:12 [Bug testsuite/108973] New: Sufficiently narrow terminal window causes selftest failure acoplan at gcc dot gnu.org
2023-03-01 21:21 ` [Bug testsuite/108973] " pinskia at gcc dot gnu.org
2023-03-01 21:22 ` [Bug testsuite/108973] [13 Regression] " pinskia at gcc dot gnu.org
2023-03-02  8:47 ` jakub at gcc dot gnu.org
2023-03-02  9:10 ` jakub at gcc dot gnu.org
2023-03-02 15:23 ` marxin at gcc dot gnu.org
2023-03-04  8:49 ` cvs-commit at gcc dot gnu.org
2023-03-04  9:29 ` [Bug testsuite/108973] [10/11/12 " jakub at gcc dot gnu.org
2023-03-19  5:30 ` cvs-commit at gcc dot gnu.org
2023-03-20 10:29 ` [Bug testsuite/108973] [10/11 " jakub at gcc dot gnu.org
2023-05-02 20:15 ` cvs-commit at gcc dot gnu.org
2023-05-03 10:42 ` [Bug testsuite/108973] [10 " jakub at gcc dot gnu.org
2023-05-03 15:22 ` cvs-commit at gcc dot gnu.org
2023-05-04  7:25 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).