[pph] Output checksum for new unexpected diff (issue4768041)

Submitted by Gab Charette on July 18, 2011, 11:36 p.m.

Details

Message ID 20110718233635.6B9341C3720@gchare.mtv.corp.google.com
State New
Headers show

Commit Message

Gab Charette July 18, 2011, 11:36 p.m.
Output the diff's sum for unexpected diffs as well (used to only output it when it had changed, but outputting it for new diffs will make it easier to generate the comment required to mark this diff as expected when needed).

Also switched from using exec calls to tr/cut, now using native TCL functions as suggested by Andreas Schwab in issue 4744043 (which was already commited then).

2011-07-18  Gabriel Charette  <gchare@google.com>

	* lib/dg-pph.exp (dg-pph-pos): Output actualSum on unexpected diff.
	Use native TCL functions instead of exec calls to tr and cut.


--
This patch is available for review at http://codereview.appspot.com/4768041

Comments

Diego Novillo July 19, 2011, 1:07 a.m.
On Mon, Jul 18, 2011 at 19:36, Gabriel Charette <gchare@google.com> wrote:

> 2011-07-18  Gabriel Charette  <gchare@google.com>
>
>        * lib/dg-pph.exp (dg-pph-pos): Output actualSum on unexpected diff.
>        Use native TCL functions instead of exec calls to tr and cut.

OK.


Diego.

Patch hide | download patch | download mbox

diff --git a/gcc/testsuite/lib/dg-pph.exp b/gcc/testsuite/lib/dg-pph.exp
index b285ccf..013ccfe 100644
--- a/gcc/testsuite/lib/dg-pph.exp
+++ b/gcc/testsuite/lib/dg-pph.exp
@@ -142,16 +142,16 @@  proc dg-pph-pos { subdir test options mapflag suffix } {
 	file_on_host delete "$bname.s+pph"
     } elseif { $adiff == 1 } {
         verbose -log "Diff obtained:\n$diff_result"
+	set actualSum [lindex [split [exec sum << $diff_result] " "] 0]
 	if { $xdiff } {
-	    set expectedSum [exec tr -d \} << [exec cut -f 4 -d\  << $xdiff_entry]]
-	    set actualSum [exec cut -f 1 -d\  << [exec sum << $diff_result]]
+	    set expectedSum [lindex [split $xdiff_entry " \}"] 3]
 	    if { $expectedSum == $actualSum } {
 	        xfail "$nshort $options (assembly comparison)"
 	    } else {
 	        fail "$nshort $options (assembly comparison, sums $expectedSum=>$actualSum)"
 	    }
 	} else {
-	    fail "$nshort $options (assembly comparison)"
+	    fail "$nshort $options (assembly comparison, sum=$actualSum)"
 	}
     } else {
 	fail "$nshort $options comparison failure"