MCPcopy Index your code
hub / github.com/foxcpp/maddy / RunCLI

Method RunCLI

tests/t.go:280–297  ·  view source on GitHub ↗
(args ...string)

Source from the content-addressed store, hash-verified

278}
279
280func (t *T) RunCLI(args ...string) (string, error) {
281 t.ensureCanRun()
282 cmd := t.buildCmd(args...)
283
284 var stderr, stdout bytes.Buffer
285 cmd.Stderr = &stderr
286 cmd.Stdout = &stdout
287
288 t.Log("launching maddy", cmd.Args)
289 if err := cmd.Run(); err != nil {
290 t.Log("Stderr:", stderr.String())
291 t.Fatal("Test configuration failed:", err)
292 }
293
294 t.Log("Stderr:", stderr.String())
295
296 return stdout.String(), nil
297}
298
299// Run completes the configuration of test environment and starts the test server.
300//

Callers 2

MustRunCLIGroupMethod · 0.95
MustRunCLIMethod · 0.95

Calls 4

ensureCanRunMethod · 0.95
buildCmdMethod · 0.95
RunMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected