MCPcopy
hub / github.com/dnote/dnote / TestMain

Function TestMain

pkg/e2e/sync/main_test.go:39–54  ·  view source on GitHub ↗
(m *testing.M)

Source from the content-addressed store, hash-verified

37}
38
39func TestMain(m *testing.M) {
40 // Build CLI binary without hardcoded API endpoint
41 // Each test will create its own server and config file
42 cmd := exec.Command("go", "build", "--tags", "fts5", "-o", cliBinaryName, "github.com/dnote/dnote/pkg/cli")
43
44 var stderr bytes.Buffer
45 cmd.Stderr = &stderr
46
47 if err := cmd.Run(); err != nil {
48 log.Print(errors.Wrap(err, "building a CLI binary").Error())
49 log.Print(stderr.String())
50 os.Exit(1)
51 }
52
53 os.Exit(m.Run())
54}

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected