aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/testing/example.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-06 17:57:23 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-06 17:57:23 +0000
commit593f74bbab63d34c7060918088bcbad686c31c66 (patch)
tree4ce83ca433796a728e9fdd00af105bce158532b5 /libgo/go/testing/example.go
parent46402cbe0ba3ea92be9642cf18eedaefe57a414c (diff)
downloadgcc-593f74bbab63d34c7060918088bcbad686c31c66.zip
gcc-593f74bbab63d34c7060918088bcbad686c31c66.tar.gz
gcc-593f74bbab63d34c7060918088bcbad686c31c66.tar.bz2
libgo: Update to weekly.2012-03-04 release.
From-SVN: r185010
Diffstat (limited to 'libgo/go/testing/example.go')
-rw-r--r--libgo/go/testing/example.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/libgo/go/testing/example.go b/libgo/go/testing/example.go
index 7f8ff2d..671c798 100644
--- a/libgo/go/testing/example.go
+++ b/libgo/go/testing/example.go
@@ -19,7 +19,7 @@ type InternalExample struct {
Output string
}
-func RunExamples(examples []InternalExample) (ok bool) {
+func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) {
ok = true
var eg InternalExample
@@ -27,6 +27,14 @@ func RunExamples(examples []InternalExample) (ok bool) {
stdout, stderr := os.Stdout, os.Stderr
for _, eg = range examples {
+ matched, err := matchString(*match, eg.Name)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "testing: invalid regexp for -test.run: %s\n", err)
+ os.Exit(1)
+ }
+ if !matched {
+ continue
+ }
if *chatty {
fmt.Printf("=== RUN: %s\n", eg.Name)
}