createServerCommand creates a command to fork and exec the test binary as an MCP server. serverName must refer to an entry in the [serverFuncs] map.
(t *testing.T, serverName string)
| 234 | // |
| 235 | // serverName must refer to an entry in the [serverFuncs] map. |
| 236 | func createServerCommand(t *testing.T, serverName string) *exec.Cmd { |
| 237 | t.Helper() |
| 238 | |
| 239 | exe, err := os.Executable() |
| 240 | if err != nil { |
| 241 | t.Fatal(err) |
| 242 | } |
| 243 | cmd := exec.Command(exe) |
| 244 | cmd.Env = append(os.Environ(), runAsServer+"="+serverName) |
| 245 | |
| 246 | return cmd |
| 247 | } |
| 248 | |
| 249 | func TestCommandTransportTerminateDuration(t *testing.T) { |
| 250 | if runtime.GOOS == "windows" { |
no outgoing calls
no test coverage detected
searching dependent graphs…