MCPcopy Index your code
hub / github.com/coder/coder / TestMain

Function TestMain

agent/agentexec/main_linux_test.go:16–27  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

14var TestBin string
15
16func 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
29func buildBinary(dir string) string {
30 path := filepath.Join(dir, "agent-test")

Callers

nothing calls this directly

Calls 5

genDirFunction · 0.85
RemoveAllMethod · 0.80
ExitMethod · 0.80
buildBinaryFunction · 0.70
RunMethod · 0.65

Tested by

no test coverage detected