public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages
@ 2007-01-27 16:56 manu at gcc dot gnu dot org
2010-04-17 12:19 ` [Bug testsuite/30612] " iains at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-01-27 16:56 UTC (permalink / raw)
To: gcc-bugs
We have seen several regressions and PRs with respect to this. It is possible
to workaround this by using:
/* { dg-bogus "message.*message" } */
/* { dg-warning "message" "" { target *-*-* } 1 } */
However, the test must be alone in one file. Otherwise, strange things may
happen.
This is obviously very cumbersome and not practical in the long run.
--
Summary: Testsuite cannot detect duplicated error/warning
messages
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: testsuite
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30612
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/30612] Testsuite cannot detect duplicated error/warning messages
2007-01-27 16:56 [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages manu at gcc dot gnu dot org
@ 2010-04-17 12:19 ` iains at gcc dot gnu dot org
2010-04-17 12:56 ` manu at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-04-17 12:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from iains at gcc dot gnu dot org 2010-04-17 12:19 -------
It seems that
/* { dg-warning "xxxx" "" } */
Is eating all lines where xxxx occurs together with the line on which the
warning is declared.
Otherwise, we'd get an excess errors (which would be perfectly fine as a way of
detecting this).
you can't even do this:
line-with-dup-warning // { dg-warning "match-text" "" }
// { dg-warning "match-text" "" { target *-*-* } last-line-no }
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30612
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/30612] Testsuite cannot detect duplicated error/warning messages
2007-01-27 16:56 [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages manu at gcc dot gnu dot org
2010-04-17 12:19 ` [Bug testsuite/30612] " iains at gcc dot gnu dot org
@ 2010-04-17 12:56 ` manu at gcc dot gnu dot org
2010-04-19 16:19 ` iains at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu dot org @ 2010-04-17 12:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from manu at gcc dot gnu dot org 2010-04-17 12:56 -------
The reason is the regexp that dejagnu uses to match the output
/usr/share/dejagnu/dg.exp
# Remove all error messages for the line [lindex $i 0]
# in the source file. If we find any, success!
set line [lindex $i 0]
set pattern [lindex $i 2]
set comment [lindex $i 3]
#send_user "Before:\n$comp_output\n"
if {[regsub -all "(^|\n)(\[^\n\]+$line\[^\n\]*($pattern)\[^\n\]*\n?)+"
$comp_output "\n" comp_output]} {
set comp_output [string trimleft $comp_output]
set ok pass
set uhoh fail
} else {
set ok fail
set uhoh pass
}
It would be nice if this were configurable or if we could override it.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2010-04-17 12:56:11
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30612
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/30612] Testsuite cannot detect duplicated error/warning messages
2007-01-27 16:56 [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages manu at gcc dot gnu dot org
2010-04-17 12:19 ` [Bug testsuite/30612] " iains at gcc dot gnu dot org
2010-04-17 12:56 ` manu at gcc dot gnu dot org
@ 2010-04-19 16:19 ` iains at gcc dot gnu dot org
2010-04-19 17:42 ` lopezibanez at gmail dot com
2010-04-19 18:26 ` iains at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-04-19 16:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from iains at gcc dot gnu dot org 2010-04-19 16:19 -------
(In reply to comment #2)
> The reason is the regexp that dejagnu uses to match the output
> /usr/share/dejagnu/dg.exp
...
> It would be nice if this were configurable or if we could override it.
yeah - I've just found another gotcha
I want to test for
warning: foo
but not
warning: foo bar.
I can't do that with:
/* { dg-warning "foo" ...
/* { dg-bogus "bar" "" { target ...
is there another way?
--
iains at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |iains at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30612
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/30612] Testsuite cannot detect duplicated error/warning messages
2007-01-27 16:56 [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages manu at gcc dot gnu dot org
` (2 preceding siblings ...)
2010-04-19 16:19 ` iains at gcc dot gnu dot org
@ 2010-04-19 17:42 ` lopezibanez at gmail dot com
2010-04-19 18:26 ` iains at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: lopezibanez at gmail dot com @ 2010-04-19 17:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from lopezibanez at gmail dot com 2010-04-19 17:42 -------
Subject: Re: Testsuite cannot detect duplicated
error/warning messages
>
> is there another way?
In this case, I think this will work:
/* { dg-bogus "foo bar" } */ /* { dg-warning "foo" } */
no?
Cheers,
Manuel.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30612
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug testsuite/30612] Testsuite cannot detect duplicated error/warning messages
2007-01-27 16:56 [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages manu at gcc dot gnu dot org
` (3 preceding siblings ...)
2010-04-19 17:42 ` lopezibanez at gmail dot com
@ 2010-04-19 18:26 ` iains at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu dot org @ 2010-04-19 18:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from iains at gcc dot gnu dot org 2010-04-19 18:26 -------
(In reply to comment #4)
> Subject: Re: Testsuite cannot detect duplicated
> error/warning messages
> In this case, I think this will work:
>
> /* { dg-bogus "foo bar" } */ /* { dg-warning "foo" } */
>
> no?
well, apparently not ; with two comments on one line I get a dg error.
If I put them on consecutive lines..
In the case that both tests pass - all is OK.
in the case that the dg-bogus test fails the second test also fails - I guess
dg-bogus eats output lines like warning does.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30612
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-19 18:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-27 16:56 [Bug testsuite/30612] New: Testsuite cannot detect duplicated error/warning messages manu at gcc dot gnu dot org
2010-04-17 12:19 ` [Bug testsuite/30612] " iains at gcc dot gnu dot org
2010-04-17 12:56 ` manu at gcc dot gnu dot org
2010-04-19 16:19 ` iains at gcc dot gnu dot org
2010-04-19 17:42 ` lopezibanez at gmail dot com
2010-04-19 18:26 ` iains at gcc dot gnu dot 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).