From 4ccad563d2a3559f0557bfb177bcf45144219bdf Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 23 Oct 2012 04:31:11 +0000 Subject: libgo: Update to current sources. From-SVN: r192704 --- libgo/testsuite/gotest | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libgo/testsuite') diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest index 208cbaf..bbe77cc 100755 --- a/libgo/testsuite/gotest +++ b/libgo/testsuite/gotest @@ -346,6 +346,11 @@ fi # They all compile; now generate the code to call them. +testname() { + # Remove the package from the name used with the -test option. + echo $1 | sed 's/^.*\.//' +} + localname() { # The package main has been renamed to __main__ when imported. # Adjust its uses. @@ -373,7 +378,7 @@ localname() { fi # benchmarks are named BenchmarkFoo. pattern='Benchmark([^a-z].*)?' - benchmarks=$($NM -p -v _gotest_.o $xofile | egrep " $test .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) + benchmarks=$($NM -p -v _gotest_.o $xofile | egrep " $text .*\."$pattern'$' | grep -v '\..*\..*\.' | fgrep -v '$' | fgrep -v ' __go_' | sed 's/.* //' | $symtogo) # examples are named ExampleFoo pattern='Example([^a-z].*)?' @@ -396,8 +401,9 @@ localname() { echo 'var tests = []testing.InternalTest {' for i in $tests do + n=$(testname $i) j=$(localname $i) - echo ' {"'$i'", '$j'},' + echo ' {"'$n'", '$j'},' done echo '}' @@ -407,8 +413,9 @@ localname() { echo 'var benchmarks = []testing.InternalBenchmark{ //' for i in $benchmarks do + n=$(testname $i) j=$(localname $i) - echo ' {"'$i'", '$j'},' + echo ' {"'$n'", '$j'},' done echo '}' @@ -417,8 +424,9 @@ localname() { # This doesn't work because we don't pick up the output. #for i in $examples #do + # n=$(testname $i) # j=$(localname $i) - # echo ' {"'$i'", '$j', ""},' + # echo ' {"'$n'", '$j', ""},' #done echo '}' -- cgit v1.1