public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Harald Anlauf <anlauf@gmx.de>
Cc: fortran <fortran@gcc.gnu.org>
Subject: Re: Testsuite, dejagnu
Date: Mon, 30 Jan 2023 13:13:34 -0800	[thread overview]
Message-ID: <CA+=Sn1mnogLT1RxGmT2=23KUpDhBnM69-B6EJ9ukGHW7tBTvbQ@mail.gmail.com> (raw)
In-Reply-To: <trinity-b30a796b-8284-485a-8258-668f0ebf7228-1675110422455@3c-app-gmx-bs48>

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
>

  reply	other threads:[~2023-01-30 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 20:27 Harald Anlauf
2023-01-30 21:13 ` Andrew Pinski [this message]
2023-01-30 21:45   ` Aw: " Harald Anlauf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+=Sn1mnogLT1RxGmT2=23KUpDhBnM69-B6EJ9ukGHW7tBTvbQ@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).