MCPcopy
hub / github.com/gotify/server / SetupSuite

Method SetupSuite

plugin/compat/wrap_test.go:27–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func (s *CompatSuite) SetupSuite() {
28 s.tmpDir = test.NewTmpDir("gotify_compatsuite")
29
30 test.WithWd(path.Join(test.GetProjectDir(), "./plugin/example/echo"), func(origWd string) {
31 exec.Command("go", "get", "-d").Run()
32 goBuildFlags := []string{"build", "-buildmode=plugin", "-o=" + s.tmpDir.Path("echo.so")}
33
34 goBuildFlags = append(goBuildFlags, extraGoBuildFlags...)
35
36 cmd := exec.Command("go", goBuildFlags...)
37 cmd.Stderr = os.Stderr
38 assert.Nil(s.T(), cmd.Run())
39 })
40
41 plugin, err := plugin.Open(s.tmpDir.Path("echo.so"))
42 assert.Nil(s.T(), err)
43 wrappedPlugin, err := Wrap(plugin)
44 assert.Nil(s.T(), err)
45
46 s.p = wrappedPlugin
47}
48
49func (s *CompatSuite) TearDownSuite() {
50 assert.Nil(s.T(), s.tmpDir.Clean())

Callers

nothing calls this directly

Calls 6

NewTmpDirFunction · 0.92
WithWdFunction · 0.92
GetProjectDirFunction · 0.92
WrapFunction · 0.85
PathMethod · 0.80
OpenMethod · 0.80

Tested by

no test coverage detected