(m *testing.M)
| 14 | var TestBin string |
| 15 | |
| 16 | func TestMain(m *testing.M) { |
| 17 | code := func() int { |
| 18 | // We generate a unique directory per test invocation to avoid collisions between two |
| 19 | // processes attempting to create the same temp file. |
| 20 | dir := genDir() |
| 21 | defer os.RemoveAll(dir) |
| 22 | TestBin = buildBinary(dir) |
| 23 | return m.Run() |
| 24 | }() |
| 25 | |
| 26 | os.Exit(code) |
| 27 | } |
| 28 | |
| 29 | func buildBinary(dir string) string { |
| 30 | path := filepath.Join(dir, "agent-test") |
nothing calls this directly
no test coverage detected