diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-03-06 17:57:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-03-06 17:57:23 +0000 |
commit | 593f74bbab63d34c7060918088bcbad686c31c66 (patch) | |
tree | 4ce83ca433796a728e9fdd00af105bce158532b5 /libgo/go/testing/example.go | |
parent | 46402cbe0ba3ea92be9642cf18eedaefe57a414c (diff) | |
download | gcc-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.go | 10 |
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) } |