This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] gcc/testsuite: guality.exp: Fix `test_counts' restoration
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mike Stump <mikestump at comcast dot net>, VandeVondele Joost <joost dot vandevondele at mat dot ethz dot ch>, David Malcolm <dmalcolm at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 14 Nov 2014 21:01:25 +0000
- Subject: [PATCH] gcc/testsuite: guality.exp: Fix `test_counts' restoration
- Authentication-results: sourceware.org; auth=none
- References: <1410381512 dot 28338 dot 9 dot camel at surprise> <20140910210822 dot GK17454 at tucnak dot redhat dot com> <20140910212334 dot GL17454 at tucnak dot redhat dot com> <20140911075123 dot GN17454 at tucnak dot redhat dot com> <20140911080640 dot GP17454 at tucnak dot redhat dot com> <20140911145300 dot GR17454 at tucnak dot redhat dot com> <908103EDB4893A42920B21D3568BFD93150F876D at MBX23 dot d dot ethz dot ch> <908103EDB4893A42920B21D3568BFD93150FE8D2 at MBX13 dot d dot ethz dot ch> <20140912163241 dot GC17454 at tucnak dot redhat dot com> <305370A6-ACBC-4DD4-AF96-32B3503F3388 at comcast dot net> <20140915160549 dot GM17454 at tucnak dot redhat dot com>
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
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
}