MCPcopy
hub / github.com/google/mtail / TestLoadProg

Function TestLoadProg

internal/runtime/runtime_test.go:75–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

73}
74
75func TestLoadProg(t *testing.T) {
76 store := metrics.NewStore()
77 tmpDir := testutil.TestTempDir(t)
78
79 lines := make(chan *logline.LogLine)
80 var wg sync.WaitGroup
81 l, err := New(lines, &wg, tmpDir, store)
82 testutil.FatalIfErr(t, err)
83
84 for _, name := range testProgFiles {
85 f := testutil.TestOpenFile(t, filepath.Join(tmpDir, name))
86 n, err := f.WriteString(testProgram)
87 testutil.FatalIfErr(t, err)
88 glog.Infof("Wrote %d bytes", n)
89 err = l.LoadProgram(filepath.Join(tmpDir, name))
90 testutil.FatalIfErr(t, err)
91 f.Close()
92 }
93 close(lines)
94 wg.Wait()
95}

Callers

nothing calls this directly

Calls 6

NewStoreFunction · 0.92
TestTempDirFunction · 0.92
FatalIfErrFunction · 0.92
TestOpenFileFunction · 0.92
LoadProgramMethod · 0.80
NewFunction · 0.50

Tested by

no test coverage detected