getPanicParseDir returns the path to the root directory of panicparse package, using "/" as path separator.
(t *testing.T)
| 2490 | // getPanicParseDir returns the path to the root directory of panicparse |
| 2491 | // package, using "/" as path separator. |
| 2492 | func getPanicParseDir(t *testing.T) string { |
| 2493 | // We assume that the working directory is the directory containing this |
| 2494 | // source. In Go test framework, this normally holds true. If this ever |
| 2495 | // becomes false, let's fix this. |
| 2496 | thisDir, err := os.Getwd() |
| 2497 | if err != nil { |
| 2498 | t.Fatal(err) |
| 2499 | } |
| 2500 | // "/" is used even on Windows in the stack trace, return in this format to |
| 2501 | // simply our life. |
| 2502 | return strings.Replace(filepath.Dir(thisDir), "\\", "/", -1) |
| 2503 | } |
| 2504 | |
| 2505 | func createTree(t *testing.T, root string, tree map[string]string) { |
| 2506 | for path, content := range tree { |
no outgoing calls
no test coverage detected
searching dependent graphs…