From 00a2a94c1eab027bc1ac5bbb9f30329dec14cf87 Mon Sep 17 00:00:00 2001 From: Marcel van Lohuizen Date: Fri, 29 Jan 2016 16:57:02 +0100 Subject: testing: added name matcher and sanitizer The matcher is responsible for sanitizing and uniquing the test and benchmark names and thus needs to be included before the API can be exposed. Matching currently uses the regexp to only match the top-level tests/benchmarks. Support for subtest matching is for another CL. Change-Id: I7c8464068faef7ebc179b03a7fe3d01122cc4f0b Reviewed-on: https://go-review.googlesource.com/18897 Reviewed-by: Russ Cox Run-TryBot: Marcel van Lohuizen TryBot-Result: Gobot Gobot --- src/testing/sub_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/testing/sub_test.go') diff --git a/src/testing/sub_test.go b/src/testing/sub_test.go index 07f6785c13..58def85441 100644 --- a/src/testing/sub_test.go +++ b/src/testing/sub_test.go @@ -6,6 +6,7 @@ package testing import ( "io/ioutil" + "regexp" "sync/atomic" "time" ) @@ -305,11 +306,12 @@ func TestTRun(t *T) { }, }} for _, tc := range testCases { - ctx := newTestContext(tc.maxPar) + ctx := newTestContext(tc.maxPar, newMatcher(regexp.MatchString, "", "")) root := &T{ common: common{ - barrier: make(chan bool), - w: ioutil.Discard, + signal: make(chan bool), + name: "Test", + w: ioutil.Discard, }, context: ctx, } -- cgit v1.3-5-g9baa