Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit a29880b

Browse files
committed
sub test and sub benchmark auto instrumentation
1 parent eea4455 commit a29880b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

instrumentation/testing/go_benchmark.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ func (b *goB) run() bool
7474
//go:linkname (*goB).add testing.(*B).add
7575
func (b *goB) add(other testing.BenchmarkResult)
7676

77-
// we clone the same (*testing.B).Run implementation because the Patch overwrite the original implementation with the jump
77+
// we clone the same (*testing.B).Run implementation because the Patch
78+
// overwrites the original implementation with the jump
7879
func (b *goB) Run(name string, f func(b *testing.B)) bool {
7980
atomic.StoreInt32(&b.hasSub, 1)
8081
benchmarkLock.Unlock()

instrumentation/testing/go_testing.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ func tRunner(t *goT, fn func(t *goT)) {
7878
goTRunner(t.ToTestingT(), func(t *testing.T) { fn(FromTestingT(t)) })
7979
}
8080

81-
// we clone the same (*testing.T).Run implementation because the Patch overwrite the original implementation with the jump
81+
// we clone the same (*testing.T).Run implementation because the Patch
82+
// overwrites the original implementation with the jump
8283
func (t *goT) Run(name string, f func(t *goT)) bool {
8384
atomic.StoreInt32(&t.hasSub, 1)
8485
testName, ok, _ := t.context.match.fullName(&t.goCommon, name)

instrumentation/testing/logger.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ func patch(methodName string, methodBody func(test *Test, argsValues []reflect.V
160160
func logOnError(err error) {
161161
if err != nil {
162162
instrumentation.Logger().Println(err)
163-
fmt.Println(err)
164163
}
165164
}
166165

0 commit comments

Comments
 (0)