Patchwork libgo patch committed: Fix testsuite for PPC

login
register
mail settings
Submitter Ian Taylor
Date April 20, 2012, 4:49 a.m.
Message ID <mcrsjfzaty5.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/153926/
State New
Headers show

Comments

Ian Taylor - April 20, 2012, 4:49 a.m.
The change to the libgo testsuite script to look at data symbols for
function descriptors on PowerPC caused the script to pick up interface
method tables and the like for types named Test*.  This patch adds a
grep -v to trim those out again.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu and powerpc64-unknown-linux-gnu.  Committed to
mainline and 4.7 branch.

Ian

Patch

diff -r 2ba470ed797c libgo/testsuite/gotest
--- a/libgo/testsuite/gotest	Mon Apr 16 16:03:29 2012 -0700
+++ b/libgo/testsuite/gotest	Thu Apr 19 21:44:55 2012 -0700
@@ -347,18 +347,18 @@ 
 	pattern='Test([^a-z].*)?'
 	# The -p option tells GNU nm not to sort.
 	# The -v option tells Solaris nm to sort by value.
-	tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
+	tests=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
 	if [ "x$tests" = x ]; then
 		echo 'gotest: warning: no tests matching '$pattern in _gotest_.o $xofile 1>&2
 		exit 2
 	fi
 	# benchmarks are named BenchmarkFoo.
 	pattern='Benchmark([^a-z].*)?'
-	benchmarks=$($NM -p -v _gotest_.o $xofile | egrep ' T .*\.'$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
+	benchmarks=$($NM -p -v _gotest_.o $xofile | egrep " $test .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
 
 	# examples are named ExampleFoo
 	pattern='Example([^a-z].*)?'
-	examples=$($NM -p -v _gotest_.o $xofile | egrep ' T .*\.'$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
+	examples=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | sed 's/.*\.\(.*\.\)/\1/')
 
 	# package spec
 	echo 'package main'