diff mbox

Fix sporadic failure of gcc.dg/cpp/pr66415-1.c

Message ID AM4PR0701MB2162B91CEF9728A05A3BA99BE4170@AM4PR0701MB2162.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger Aug. 20, 2016, 5:53 a.m. UTC
Hi,

it turns out that in this test case the expected output depends on the COLUMNS
setting of the terminal where the test suite is started.  With less than 82 columns
the multiline output is not as expected.

The reason for that seems to be at diagnostic_set_caret_max_width where
it is dependent on isatty(fileno(stderr)) if get_terminal_width gets called.
And looking at get_terminal_width it is clear that the different COLUMNS
setting make the difference.

With the following patch the test case succeeds independently of the terminal
settings.


Is it OK for trunk?


Thanks
Bernd.

Comments

Richard Biener Aug. 22, 2016, 7:12 a.m. UTC | #1
On Sat, Aug 20, 2016 at 7:53 AM, Bernd Edlinger
<bernd.edlinger@hotmail.de> wrote:
> Hi,
>
> it turns out that in this test case the expected output depends on the COLUMNS
> setting of the terminal where the test suite is started.  With less than 82 columns
> the multiline output is not as expected.
>
> The reason for that seems to be at diagnostic_set_caret_max_width where
> it is dependent on isatty(fileno(stderr)) if get_terminal_width gets called.
> And looking at get_terminal_width it is clear that the different COLUMNS
> setting make the difference.
>
> With the following patch the test case succeeds independently of the terminal
> settings.
>
>
> Is it OK for trunk?

Ok.

Richard.

>
> Thanks
> Bernd.
diff mbox

Patch

2016-08-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR c/52952
	* gcc.dg/cpp/pr66415-1.c: Fix sporadic failure.

Index: gcc/testsuite/gcc.dg/cpp/pr66415-1.c
===================================================================
--- gcc/testsuite/gcc.dg/cpp/pr66415-1.c	(revision 239624)
+++ gcc/testsuite/gcc.dg/cpp/pr66415-1.c	(working copy)
@@ -1,6 +1,7 @@ 
 /* PR c/66415 */
 /* { dg-do compile } */
 /* { dg-options "-Wformat -fdiagnostics-show-caret" } */
+/* { dg-set-compiler-env-var COLUMNS "82" } */
 
 void
 fn1 (void)