Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* dg-extract-results.sh truncates logs containing "Running "
@ 2013-01-14 19:56 David Blaikie
  2013-01-15 16:17 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: David Blaikie @ 2013-01-14 19:56 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 505 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 (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.

[-- 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] 5+ messages in thread

* Re: dg-extract-results.sh truncates logs containing "Running "
  2013-01-14 19:56 dg-extract-results.sh truncates logs containing "Running " David Blaikie
@ 2013-01-15 16:17 ` Pedro Alves
  2013-01-17  2:24   ` David Blaikie
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-01-15 16:17 UTC (permalink / raw)
  To: David Blaikie; +Cc: gdb-patches

Same script, same comment as the previous patch.
Can you send this to gcc-patches@ , please?

Thanks,
-- 
Pedro Alves


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

* Re: dg-extract-results.sh truncates logs containing "Running "
  2013-01-15 16:17 ` Pedro Alves
@ 2013-01-17  2:24   ` David Blaikie
  2013-01-17 13:47     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: David Blaikie @ 2013-01-17  2:24 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Tue, Jan 15, 2013 at 7:25 AM, Pedro Alves <palves@redhat.com> wrote:
> Same script, same comment as the previous patch.
> Can you send this to gcc-patches@ , please?

This & the other patch have both been submitted upstream in GCC:

------------------------------------------------------------------------
r195224 | janis | 2013-01-15 19:42:31 -0800 (Tue, 15 Jan 2013) | 4 lines

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

        * dg-extract-results.sh: Fix order of summary counts.

------------------------------------------------------------------------
r195216 | janis | 2013-01-15 12:19:33 -0800 (Tue, 15 Jan 2013) | 4 lines

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

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

------------------------------------------------------------------------
r195215 | janis | 2013-01-15 12:18:20 -0800 (Tue, 15 Jan 2013) | 4 lines

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

        * dg-extract-results.sh: Handle KPASSes.


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

* Re: dg-extract-results.sh truncates logs containing "Running "
  2013-01-17  2:24   ` David Blaikie
@ 2013-01-17 13:47     ` Pedro Alves
  2013-01-17 14:38       ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-01-17 13:47 UTC (permalink / raw)
  To: David Blaikie; +Cc: gdb-patches

On 01/17/2013 02:24 AM, David Blaikie wrote:
> On Tue, Jan 15, 2013 at 7:25 AM, Pedro Alves <palves@redhat.com> wrote:
>> Same script, same comment as the previous patch.
>> Can you send this to gcc-patches@ , please?
> 
> This & the other patch have both been submitted upstream in GCC:

Thanks, I'll handle the merging.

-- 
Pedro Alves


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

* Re: dg-extract-results.sh truncates logs containing "Running "
  2013-01-17 13:47     ` Pedro Alves
@ 2013-01-17 14:38       ` Pedro Alves
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2013-01-17 14:38 UTC (permalink / raw)
  Cc: David Blaikie, gdb-patches

On 01/17/2013 01:47 PM, Pedro Alves wrote:
> On 01/17/2013 02:24 AM, David Blaikie wrote:
>> On Tue, Jan 15, 2013 at 7:25 AM, Pedro Alves <palves@redhat.com> wrote:
>>> Same script, same comment as the previous patch.
>>> Can you send this to gcc-patches@ , please?
>>
>> This & the other patch have both been submitted upstream in GCC:
> 
> Thanks, I'll handle the merging.

Done.  Tested on x86_64 Fedora 17, and committed.  Patch
at the bottom.

Thanks David.

This brings in a 2010 change too.

A difference in the copyright headers remains afterwards:

 $ diff -up /home/pedro/src/gcc/src/contrib/dg-extract-results.sh  dg-extract-results.sh
 --- /home/pedro/src/gcc/src/contrib/dg-extract-results.sh       2013-01-17 13:29:24.371296122 +0000
 +++ dg-extract-results.sh       2013-01-17 14:18:45.537707397 +0000
 @@ -6,7 +6,7 @@
  # The resulting file can be used with test result comparison scripts for
  # results from tests that were run in parallel.  See usage() below.
  
 -# Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation
 +# Copyright (C) 2008-2013 Free Software Foundation, Inc.
  # Contributed by Janis Johnson <janis187@us.ibm.com>
  #
  # This file is part of GCC.
 @@ -22,9 +22,7 @@
  # GNU General Public License for more details.
  #
  # You should have received a copy of the GNU General Public License
 -# along with GCC; see the file COPYING.  If not, write to
 -# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 -# Boston, MA 02110-1301, USA.
 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
  PROGNAME=dg-extract-results.sh

I saw that GCC is going through the process of
updating all their files to mention 2013 with a year range,
with a script, and moving to updating the years once
per year, like we do, so I'll just leave it at
that, and the difference may resolve itself in the
next weeks.

Can we add this file to the list of "3rd party" files
(I don't know where that is) that shouldn't get their
headers auto-updated in the future?

gdb/testsuite/
2013-01-17  Pedro Alves  <palves@redhat.com>

	Merge dg-extract-results.sh from upstream (svn 195224).

	2013-01-15  David Blaikie <dblaikie@gmail.com>
    	* dg-extract-results.sh: Fix order of summary counts.

	2013-01-15  David Blaikie <dblaikie@gmail.com>
    	* dg-extract-results.sh: Constrain the start-of-log pattern.

	2013-01-15  David Blaikie <dblaikie@gmail.com>
    	* dg-extract-results.sh: Handle KPASSes.

	2010-05-25  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
	* dg-extract-results.sh: Redirect grep output to /dev/null instead
	of grep -q.
---

 gdb/testsuite/dg-extract-results.sh |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/dg-extract-results.sh b/gdb/testsuite/dg-extract-results.sh
index 574833e..7df2bb4 100755
--- a/gdb/testsuite/dg-extract-results.sh
+++ b/gdb/testsuite/dg-extract-results.sh
@@ -222,7 +222,7 @@ else
   VARIANTS=""
   for VAR in $VARS
   do
-    grep -q "Running target $VAR" $SUM_FILES && VARIANTS="$VARIANTS $VAR"
+    grep "Running target $VAR" $SUM_FILES > /dev/null && VARIANTS="$VARIANTS $VAR"
   done
 fi
 
@@ -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)
@@ -343,7 +343,7 @@ EOF
 BEGIN {
   variant="$VAR"
   tool="$TOOL"
-  passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; kfailcnt=0; unsupcnt=0; unrescnt=0;
+  passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; kpasscnt=0; kfailcnt=0; unsupcnt=0; unrescnt=0;
   curvar=""; insummary=0
 }
 /^Running target /		{ curvar = \$3; next }
@@ -352,6 +352,7 @@ BEGIN {
 /^# of unexpected successes/	{ if (insummary == 1) xpasscnt += \$5; next; }
 /^# of unexpected failures/	{ if (insummary == 1) failcnt += \$5; next; }
 /^# of expected failures/	{ if (insummary == 1) xfailcnt += \$5; next; }
+/^# of unknown successes/	{ if (insummary == 1) kpasscnt += \$5; next; }
 /^# of known failures/		{ if (insummary == 1) kfailcnt += \$5; next; }
 /^# of untested testcases/	{ if (insummary == 1) untstcnt += \$5; next; }
 /^# of unresolved testcases/	{ if (insummary == 1) unrescnt += \$5; next; }
@@ -367,6 +368,7 @@ END {
   if (failcnt != 0) printf ("# of unexpected failures\t%d\n", failcnt)
   if (xpasscnt != 0) printf ("# of unexpected successes\t%d\n", xpasscnt)
   if (xfailcnt != 0) printf ("# of expected failures\t\t%d\n", xfailcnt)
+  if (kpasscnt != 0) printf ("# of unknown successes\t\t%d\n", kpasscnt)
   if (kfailcnt != 0) printf ("# of known failures\t\t%d\n", kfailcnt)
   if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
   if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
@@ -397,6 +399,7 @@ BEGIN {
 /^# of unexpected failures/	{ failcnt += \$5 }
 /^# of unexpected successes/	{ xpasscnt += \$5 }
 /^# of expected failures/	{ xfailcnt += \$5 }
+/^# of unknown successes/	{ kpasscnt += \$5 }
 /^# of known failures/		{ kfailcnt += \$5 }
 /^# of untested testcases/	{ untstcnt += \$5 }
 /^# of unresolved testcases/	{ unrescnt += \$5 }
@@ -407,6 +410,7 @@ END {
   if (failcnt != 0) printf ("# of unexpected failures\t%d\n", failcnt)
   if (xpasscnt != 0) printf ("# of unexpected successes\t%d\n", xpasscnt)
   if (xfailcnt != 0) printf ("# of expected failures\t\t%d\n", xfailcnt)
+  if (kpasscnt != 0) printf ("# of unknown successes\t\t%d\n", kpasscnt)
   if (kfailcnt != 0) printf ("# of known failures\t\t%d\n", kfailcnt)
   if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
   if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
@@ -420,6 +424,6 @@ cat ${TMP}/var-* | $AWK -f $TOTAL_AWK
 # This is ugly, but if there's version output from the compiler under test
 # at the end of the file, we want it.  The other thing that might be there
 # is the final summary counts.
-tail -2 $FIRST_SUM | grep -q '^#' || tail -2 $FIRST_SUM
+tail -2 $FIRST_SUM | grep '^#' > /dev/null || tail -2 $FIRST_SUM
 
 exit 0


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

end of thread, other threads:[~2013-01-17 14:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14 19:56 dg-extract-results.sh truncates logs containing "Running " David Blaikie
2013-01-15 16:17 ` Pedro Alves
2013-01-17  2:24   ` David Blaikie
2013-01-17 13:47     ` Pedro Alves
2013-01-17 14:38       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox