* Testsuite, dejagnu
@ 2023-01-30 20:27 Harald Anlauf
2023-01-30 21:13 ` Andrew Pinski
0 siblings, 1 reply; 3+ messages in thread
From: Harald Anlauf @ 2023-01-30 20:27 UTC (permalink / raw)
To: fortran
Dear Hackers,
is there a way to check that a particular warning is emitted only
once for a source code line instead of multiple times?
It appears that by default dg-warn matches one or more times.
Thanks,
Harald
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Testsuite, dejagnu
2023-01-30 20:27 Testsuite, dejagnu Harald Anlauf
@ 2023-01-30 21:13 ` Andrew Pinski
2023-01-30 21:45 ` Aw: " Harald Anlauf
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Pinski @ 2023-01-30 21:13 UTC (permalink / raw)
To: Harald Anlauf; +Cc: fortran
On Mon, Jan 30, 2023 at 12:27 PM Harald Anlauf via Fortran
<fortran@gcc.gnu.org> wrote:
>
> Dear Hackers,
>
> is there a way to check that a particular warning is emitted only
> once for a source code line instead of multiple times?
>
> It appears that by default dg-warn matches one or more times.
One example of how to do this is located in testsuite/g++.dg/lookup/duperr1.C .
I don't know if this is the best way of doing it though.
Basically it uses dg-bogus to match the multiple warnings (since it is
a regex over all output lines and `.*` will even match new lines) so
you get a failure if there was a duplicated one and then dg-message to
match the original message just to make sure it is outputted once
(dg-message was because it was originally a note: rather than a
warning/error but similar thing can be done for dg-error/dg-warning).
Thanks,
Andrew Pinski
>
> Thanks,
> Harald
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Aw: Re: Testsuite, dejagnu
2023-01-30 21:13 ` Andrew Pinski
@ 2023-01-30 21:45 ` Harald Anlauf
0 siblings, 0 replies; 3+ messages in thread
From: Harald Anlauf @ 2023-01-30 21:45 UTC (permalink / raw)
To: Andrew Pinski; +Cc: fortran
Hi Andrew,
> Gesendet: Montag, 30. Januar 2023 um 22:13 Uhr
> Von: "Andrew Pinski" <pinskia@gmail.com>
> An: "Harald Anlauf" <anlauf@gmx.de>
> Cc: "fortran" <fortran@gcc.gnu.org>
> Betreff: Re: Testsuite, dejagnu
>
> On Mon, Jan 30, 2023 at 12:27 PM Harald Anlauf via Fortran
> <fortran@gcc.gnu.org> wrote:
> >
> > Dear Hackers,
> >
> > is there a way to check that a particular warning is emitted only
> > once for a source code line instead of multiple times?
> >
> > It appears that by default dg-warn matches one or more times.
>
> One example of how to do this is located in testsuite/g++.dg/lookup/duperr1.C .
> I don't know if this is the best way of doing it though.
> Basically it uses dg-bogus to match the multiple warnings (since it is
> a regex over all output lines and `.*` will even match new lines) so
> you get a failure if there was a duplicated one and then dg-message to
> match the original message just to make sure it is outputted once
> (dg-message was because it was originally a note: rather than a
> warning/error but similar thing can be done for dg-error/dg-warning).
yes, that can be used to make it work for the Fortran testcase at hand!
Thanks,
Harald
>
> Thanks,
> Andrew Pinski
>
>
> >
> > Thanks,
> > Harald
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-30 21:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 20:27 Testsuite, dejagnu Harald Anlauf
2023-01-30 21:13 ` Andrew Pinski
2023-01-30 21:45 ` Aw: " Harald Anlauf
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).