public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* dg-extract-results.sh truncates logs containing "Running "
@ 2013-01-15 16:31 David Blaikie
  2013-01-15 17:16 ` David Blaikie
  0 siblings, 1 reply; 3+ messages in thread
From: David Blaikie @ 2013-01-15 16:31 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 959 bytes --]

The regex to detect the beginning of a test file execution was too
broad, matching any line beginning with "Running ". This caused
dg-extract-results.sh to truncate some test logs, including
gdb.base/help.exp in the GDB test suite (which tests "help running",
printing "Running the program.")

The attached patch makes the match a little more precise to avoid
this. With this the exact count of PASS/FAIL/etc lines in the
dg-extract-results.sh output matches the counts in the computed
summary exactly for all cases I've seen.

I encountered this in the GDB test suite but was asked to submit the
change upstream to GCC as GDB would prefer to avoid unnecessary local
changes to the script & this change seems general enough to go in to
GCC.

I'm still a little fuzzy on the specifics of ChangeLog lines, but
here's my attempt at one for this change:

    * dg-extract-results.sh: constrain the start-of-log pattern to
avoid accidentally matching test content

[-- Attachment #2: extract-running.diff --]
[-- Type: application/octet-stream, Size: 423 bytes --]

diff --git gdb/testsuite/dg-extract-results.sh gdb/testsuite/dg-extract-results.sh
index 574833e..c67b5ca 100755
--- gdb/testsuite/dg-extract-results.sh
+++ gdb/testsuite/dg-extract-results.sh
@@ -286,7 +286,7 @@ BEGIN {
 /^Using / {
   if (variant == curvar && print_using) { print; next }
 }
-/^Running / {
+/^Running .*\\.exp \\.\\.\\./ {
   print_using=0
   if (variant == curvar) {
     if (need_close) close(curfile)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dg-extract-results.sh truncates logs containing "Running "
  2013-01-15 16:31 dg-extract-results.sh truncates logs containing "Running " David Blaikie
@ 2013-01-15 17:16 ` David Blaikie
  2013-01-15 20:21   ` Janis Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: David Blaikie @ 2013-01-15 17:16 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

& now with an actual GCC patch, instead of the GDB one - sorry about that.

On Tue, Jan 15, 2013 at 8:31 AM, David Blaikie <dblaikie@gmail.com> wrote:
> The regex to detect the beginning of a test file execution was too
> broad, matching any line beginning with "Running ". This caused
> dg-extract-results.sh to truncate some test logs, including
> gdb.base/help.exp in the GDB test suite (which tests "help running",
> printing "Running the program.")
>
> The attached patch makes the match a little more precise to avoid
> this. With this the exact count of PASS/FAIL/etc lines in the
> dg-extract-results.sh output matches the counts in the computed
> summary exactly for all cases I've seen.
>
> I encountered this in the GDB test suite but was asked to submit the
> change upstream to GCC as GDB would prefer to avoid unnecessary local
> changes to the script & this change seems general enough to go in to
> GCC.
>
> I'm still a little fuzzy on the specifics of ChangeLog lines, but
> here's my attempt at one for this change:
>
>     * dg-extract-results.sh: constrain the start-of-log pattern to
> avoid accidentally matching test content

[-- Attachment #2: gcc-extract-running.diff --]
[-- Type: application/octet-stream, Size: 428 bytes --]

Index: contrib/dg-extract-results.sh
===================================================================
--- contrib/dg-extract-results.sh	(revision 195208)
+++ contrib/dg-extract-results.sh	(working copy)
@@ -288,7 +288,7 @@
 /^Using / {
   if (variant == curvar && print_using) { print; next }
 }
-/^Running / {
+/^Running .*\\.exp \\.\\.\\./ {
   print_using=0
   if (variant == curvar) {
     if (need_close) close(curfile)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dg-extract-results.sh truncates logs containing "Running "
  2013-01-15 17:16 ` David Blaikie
@ 2013-01-15 20:21   ` Janis Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Janis Johnson @ 2013-01-15 20:21 UTC (permalink / raw)
  To: David Blaikie; +Cc: gcc-patches

On 01/15/2013 09:16 AM, David Blaikie wrote:
> & now with an actual GCC patch, instead of the GDB one - sorry about that.
> 
> On Tue, Jan 15, 2013 at 8:31 AM, David Blaikie <dblaikie@gmail.com> wrote:
>> The regex to detect the beginning of a test file execution was too
>> broad, matching any line beginning with "Running ". This caused
>> dg-extract-results.sh to truncate some test logs, including
>> gdb.base/help.exp in the GDB test suite (which tests "help running",
>> printing "Running the program.")
>>
>> The attached patch makes the match a little more precise to avoid
>> this. With this the exact count of PASS/FAIL/etc lines in the
>> dg-extract-results.sh output matches the counts in the computed
>> summary exactly for all cases I've seen.
>>
>> I encountered this in the GDB test suite but was asked to submit the
>> change upstream to GCC as GDB would prefer to avoid unnecessary local
>> changes to the script & this change seems general enough to go in to
>> GCC.
>>
>> I'm still a little fuzzy on the specifics of ChangeLog lines, but
>> here's my attempt at one for this change:
>>
>>     * dg-extract-results.sh: constrain the start-of-log pattern to
>> avoid accidentally matching test content

OK.  I checked it in, with this ChangeLog entry:

2013-01-15  David Blaikie <dblaikie@gmail.com>

        * dg-extract-results.sh: Constrain the start-of-log pattern.

Janis

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-01-15 20:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15 16:31 dg-extract-results.sh truncates logs containing "Running " David Blaikie
2013-01-15 17:16 ` David Blaikie
2013-01-15 20:21   ` Janis Johnson

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).