MCPcopy Index your code
hub / github.com/syncthing/syncthing / getTestName

Function getTestName

test/util.go:502–518  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

500}
501
502func getTestName() string {
503 callers := make([]uintptr, 100)
504 runtime.Callers(1, callers)
505 for i, caller := range callers {
506 f := runtime.FuncForPC(caller)
507 if f != nil {
508 if f.Name() == "testing.tRunner" {
509 testf := runtime.FuncForPC(callers[i-1])
510 if testf != nil {
511 path := strings.Split(testf.Name(), ".")
512 return path[len(path)-1]
513 }
514 }
515 }
516 }
517 return time.Now().String()
518}
519
520func checkedStop(t *testing.T, p *rc.Process) {
521 if _, err := p.Stop(); err != nil {

Callers 1

startInstanceFunction · 0.85

Calls 3

NameMethod · 0.65
StringMethod · 0.65
NowMethod · 0.65

Tested by

no test coverage detected