gcc/testsuite: guality.exp: Fix `test_counts' restoration
diff mbox

Message ID alpine.DEB.1.10.1411142022080.2881@tp.orcam.me.uk
State Accepted
Headers show

Commit Message

Maciej W. Rozycki Nov. 14, 2014, 9:01 p.m. UTC
On Mon, 15 Sep 2014, Jakub Jelinek wrote:

> 2014-09-14  Jakub Jelinek  <jakub@redhat.com>
> 
> gcc/testsuite/
> 	* g++.dg/guality/guality.exp (check_guality): Save/restore
> 	test_counts array around the body of the procedure.
> 	* gcc.dg/guality/guality.exp (check_guality): Likewise.
[...]
> --- gcc/testsuite/g++.dg/guality/guality.exp.jj	2014-09-14 21:09:04.767498056 +0200
> +++ gcc/testsuite/g++.dg/guality/guality.exp	2014-09-14 21:25:17.768673222 +0200
> @@ -14,6 +14,11 @@ if { [istarget "powerpc-ibm-aix*"] } {
>  }
>  
>  proc check_guality {args} {
> +    # Don't count check_guality as PASS, or FAIL etc., that would make
> +    # the total PASS count dependent on how many parallel runtest invocations
> +    # ran guality.exp.  So save the counts first and restore them afterwards.
> +    global test_counts
> +    array set saved_test_counts [array get test_counts]
>      set result [eval check_compile guality_check executable $args "-g -O0"]
>      set lines [lindex $result 0]
>      set output [lindex $result 1]
> @@ -23,6 +28,7 @@ proc check_guality {args} {
>        set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
>      }
>      remote_file build delete $output
> +    array get test_counts [array get saved_test_counts]
>      return $ret
>  }
>  

 ^-- typo here I believe, compare the corresponding change below:

> --- gcc/testsuite/gcc.dg/guality/guality.exp.jj	2014-09-14 21:09:05.362495088 +0200
> +++ gcc/testsuite/gcc.dg/guality/guality.exp	2014-09-14 21:25:17.769673197 +0200
> @@ -14,6 +14,11 @@ if { [istarget "powerpc-ibm-aix*"] } {
>  }
>  
>  proc check_guality {args} {
> +    # Don't count check_guality as PASS, or FAIL etc., that would make
> +    # the total PASS count dependent on how many parallel runtest invocations
> +    # ran guality.exp.  So save the counts first and restore them afterwards.
> +    global test_counts
> +    array set saved_test_counts [array get test_counts]
>      set result [eval check_compile guality_check executable $args "-g -O0"]
>      set lines [lindex $result 0]
>      set output [lindex $result 1]
> @@ -23,6 +28,7 @@ proc check_guality {args} {
>        set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
>      }
>      remote_file build delete $output
> +    array set test_counts [array get saved_test_counts]
>      return $ret
>  }
>  

 OK to apply?

2014-11-14  Maciej W. Rozycki  <macro@codesourcery.com>

	gcc/testsuite/ 
	* g++.dg/guality/guality.exp (check_guality): Fix `test_counts' 
	restoration.

  Maciej

gcc-test-guality.patch

Comments

Jakub Jelinek Nov. 14, 2014, 9:06 p.m. UTC | #1
On Fri, Nov 14, 2014 at 09:01:25PM +0000, Maciej W. Rozycki wrote:
> 2014-11-14  Maciej W. Rozycki  <macro@codesourcery.com>
> 
> 	gcc/testsuite/ 
> 	* g++.dg/guality/guality.exp (check_guality): Fix `test_counts' 
> 	restoration.

Ok, thanks.

> --- gcc-fsf-trunk-quilt.orig/gcc/testsuite/g++.dg/guality/guality.exp	2014-11-14 18:33:47.000000000 +0000
> +++ gcc-fsf-trunk-quilt/gcc/testsuite/g++.dg/guality/guality.exp	2014-11-14 20:18:35.038856372 +0000
> @@ -28,7 +28,7 @@ proc check_guality {args} {
>        set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
>      }
>      remote_file build delete $output
> -    array get test_counts [array get saved_test_counts]
> +    array set test_counts [array get saved_test_counts]
>      return $ret
>  }
>  

	Jakub
Maciej W. Rozycki Nov. 15, 2014, 11:20 p.m. UTC | #2
On Fri, 14 Nov 2014, Jakub Jelinek wrote:

> > 	gcc/testsuite/ 
> > 	* g++.dg/guality/guality.exp (check_guality): Fix `test_counts' 
> > 	restoration.
> 
> Ok, thanks.

 Applied, thanks.

  Maciej

Patch
diff mbox

Index: gcc-fsf-trunk-quilt/gcc/testsuite/g++.dg/guality/guality.exp
===================================================================
--- gcc-fsf-trunk-quilt.orig/gcc/testsuite/g++.dg/guality/guality.exp	2014-11-14 18:33:47.000000000 +0000
+++ gcc-fsf-trunk-quilt/gcc/testsuite/g++.dg/guality/guality.exp	2014-11-14 20:18:35.038856372 +0000
@@ -28,7 +28,7 @@  proc check_guality {args} {
       set ret [string match "*1 PASS, 0 FAIL, 0 UNRESOLVED*" $execout]
     }
     remote_file build delete $output
-    array get test_counts [array get saved_test_counts]
+    array set test_counts [array get saved_test_counts]
     return $ret
 }