This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make ubsan tests less picky about ansi escape codes in diagnostics.
- From: Jonathan Roelofs <jonathan at codesourcery dot com>
- To: Andrew Pinski <pinskia at gmail dot com>, Mike Stump <mikestump at comcast dot net>
- Cc: Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Kostya Serebryany <kcc at google dot com>
- Date: Wed, 9 Sep 2015 15:14:26 -0600
- Subject: Re: [PATCH] Make ubsan tests less picky about ansi escape codes in diagnostics.
- Authentication-results: sourceware.org; auth=none
- References: <55DF92B6 dot 6020802 at codesourcery dot com> <55E87206 dot 6030500 at codesourcery dot com> <20150903161711 dot GY1847 at tucnak dot redhat dot com> <55E8792A dot 8010909 at codesourcery dot com> <C2DCFF6D-22F2-40EC-B691-99CFCD22E9A9 at comcast dot net> <CA+=Sn1=wPstibnKb9CkGAJtymuQmkKmW-RN8EV5wRCjjp8G4Vw at mail dot gmail dot com>
On 9/9/15 9:20 AM, Andrew Pinski wrote:
On Wed, Sep 9, 2015 at 11:11 PM, Mike Stump <mikestump@comcast.net>
wrote:
On Sep 3, 2015, at 9:45 AM, Jonathan Roelofs
<jonathan@codesourcery.com> wrote:
Moral of the story is: these tests fail in our environment, but
only because the regexes do not expect the presence of the ansi
color codes, and we can't trick the runtime into not emitting
them.
When the user says, I donât want color; is color emitted? If so,
There's two ways to prevent emission of these color codes:
1) Set an env var
2) Make the output stream not a tty
Both of these pathways work.
thatâs a bug, and needs to be fixed. If the user can, then,
dejagnu can. When it says, donât use color, that should be
The issue is that I've got a remote target, and there are two
limitations of DejaGnu that prevent me from triggering either (1) or (2):
a) As Andrew says, DejaGnu can't set env vars for remote programs
under test.
b) DejaGnu makes itself appear to the remote program under test as if
it were a tty.
respected; just as if the user had said it. Anyway, a | decolor
more a la prune should be able to remove color, even if there were
no other way.
Are you suggesting that I use `dg-prune-output` to filter out these
color codes? I tried several variations on spellings of:
/* { dg-prune-output "\033\[[0-9\;]+[mK]" } */
but couldn't get any of them to work. (I'm not certain I got the
escaping correct, nor what it should be).
Jon
The issue is dejagnu cannot (at least in the current implementation
of the remotes), cannot set an env that stays alive before invoking
the program (though maybe it could use the env program to do the
invoking).
Iâm not a fan of the changes as is.
--
Jon Roelofs
jonathan@codesourcery.com
CodeSourcery / Mentor Embedded