diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-03-27 14:51:12 +0100 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-03-28 08:52:18 +0000 |
| commit | 49900278f682d353c51ae499d241e49f0e538f9d (patch) | |
| tree | a2c099df01886c8cb67d2a8daf647644f178c20c /pkg | |
| parent | a65c9492058d5c652f85e6b03185b569eae6873d (diff) | |
all/mocks: update
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/coveragedb/mocks/ReadOnlyTransaction.go | 37 | ||||
| -rw-r--r-- | pkg/coveragedb/mocks/Row.go | 36 | ||||
| -rw-r--r-- | pkg/coveragedb/mocks/RowIterator.go | 62 | ||||
| -rw-r--r-- | pkg/coveragedb/mocks/SpannerClient.go | 99 | ||||
| -rw-r--r-- | pkg/covermerger/mocks/FileVersProvider.go | 44 | ||||
| -rw-r--r-- | pkg/gcs/mocks/Client.go | 205 | ||||
| -rw-r--r-- | pkg/rpcserver/mocks/Manager.go | 119 |
7 files changed, 602 insertions, 0 deletions
diff --git a/pkg/coveragedb/mocks/ReadOnlyTransaction.go b/pkg/coveragedb/mocks/ReadOnlyTransaction.go index 82238027e..1a4eecfb8 100644 --- a/pkg/coveragedb/mocks/ReadOnlyTransaction.go +++ b/pkg/coveragedb/mocks/ReadOnlyTransaction.go @@ -16,6 +16,14 @@ type ReadOnlyTransaction struct { mock.Mock } +type ReadOnlyTransaction_Expecter struct { + mock *mock.Mock +} + +func (_m *ReadOnlyTransaction) EXPECT() *ReadOnlyTransaction_Expecter { + return &ReadOnlyTransaction_Expecter{mock: &_m.Mock} +} + // Query provides a mock function with given fields: ctx, statement func (_m *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator { ret := _m.Called(ctx, statement) @@ -36,6 +44,35 @@ func (_m *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Stat return r0 } +// ReadOnlyTransaction_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type ReadOnlyTransaction_Query_Call struct { + *mock.Call +} + +// Query is a helper method to define mock.On call +// - ctx context.Context +// - statement spanner.Statement +func (_e *ReadOnlyTransaction_Expecter) Query(ctx interface{}, statement interface{}) *ReadOnlyTransaction_Query_Call { + return &ReadOnlyTransaction_Query_Call{Call: _e.mock.On("Query", ctx, statement)} +} + +func (_c *ReadOnlyTransaction_Query_Call) Run(run func(ctx context.Context, statement spanner.Statement)) *ReadOnlyTransaction_Query_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(spanner.Statement)) + }) + return _c +} + +func (_c *ReadOnlyTransaction_Query_Call) Return(_a0 spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ReadOnlyTransaction_Query_Call) RunAndReturn(run func(context.Context, spanner.Statement) spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call { + _c.Call.Return(run) + return _c +} + // NewReadOnlyTransaction creates a new instance of ReadOnlyTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewReadOnlyTransaction(t interface { diff --git a/pkg/coveragedb/mocks/Row.go b/pkg/coveragedb/mocks/Row.go index 1a34552aa..549e7d214 100644 --- a/pkg/coveragedb/mocks/Row.go +++ b/pkg/coveragedb/mocks/Row.go @@ -9,6 +9,14 @@ type Row struct { mock.Mock } +type Row_Expecter struct { + mock *mock.Mock +} + +func (_m *Row) EXPECT() *Row_Expecter { + return &Row_Expecter{mock: &_m.Mock} +} + // ToStruct provides a mock function with given fields: p func (_m *Row) ToStruct(p interface{}) error { ret := _m.Called(p) @@ -27,6 +35,34 @@ func (_m *Row) ToStruct(p interface{}) error { return r0 } +// Row_ToStruct_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ToStruct' +type Row_ToStruct_Call struct { + *mock.Call +} + +// ToStruct is a helper method to define mock.On call +// - p interface{} +func (_e *Row_Expecter) ToStruct(p interface{}) *Row_ToStruct_Call { + return &Row_ToStruct_Call{Call: _e.mock.On("ToStruct", p)} +} + +func (_c *Row_ToStruct_Call) Run(run func(p interface{})) *Row_ToStruct_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(interface{})) + }) + return _c +} + +func (_c *Row_ToStruct_Call) Return(_a0 error) *Row_ToStruct_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Row_ToStruct_Call) RunAndReturn(run func(interface{}) error) *Row_ToStruct_Call { + _c.Call.Return(run) + return _c +} + // NewRow creates a new instance of Row. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRow(t interface { diff --git a/pkg/coveragedb/mocks/RowIterator.go b/pkg/coveragedb/mocks/RowIterator.go index 83e442b01..7bea62355 100644 --- a/pkg/coveragedb/mocks/RowIterator.go +++ b/pkg/coveragedb/mocks/RowIterator.go @@ -12,6 +12,14 @@ type RowIterator struct { mock.Mock } +type RowIterator_Expecter struct { + mock *mock.Mock +} + +func (_m *RowIterator) EXPECT() *RowIterator_Expecter { + return &RowIterator_Expecter{mock: &_m.Mock} +} + // Next provides a mock function with no fields func (_m *RowIterator) Next() (spannerclient.Row, error) { ret := _m.Called() @@ -42,11 +50,65 @@ func (_m *RowIterator) Next() (spannerclient.Row, error) { return r0, r1 } +// RowIterator_Next_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Next' +type RowIterator_Next_Call struct { + *mock.Call +} + +// Next is a helper method to define mock.On call +func (_e *RowIterator_Expecter) Next() *RowIterator_Next_Call { + return &RowIterator_Next_Call{Call: _e.mock.On("Next")} +} + +func (_c *RowIterator_Next_Call) Run(run func()) *RowIterator_Next_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RowIterator_Next_Call) Return(_a0 spannerclient.Row, _a1 error) *RowIterator_Next_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RowIterator_Next_Call) RunAndReturn(run func() (spannerclient.Row, error)) *RowIterator_Next_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with no fields func (_m *RowIterator) Stop() { _m.Called() } +// RowIterator_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type RowIterator_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +func (_e *RowIterator_Expecter) Stop() *RowIterator_Stop_Call { + return &RowIterator_Stop_Call{Call: _e.mock.On("Stop")} +} + +func (_c *RowIterator_Stop_Call) Run(run func()) *RowIterator_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RowIterator_Stop_Call) Return() *RowIterator_Stop_Call { + _c.Call.Return() + return _c +} + +func (_c *RowIterator_Stop_Call) RunAndReturn(run func()) *RowIterator_Stop_Call { + _c.Run(run) + return _c +} + // NewRowIterator creates a new instance of RowIterator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRowIterator(t interface { diff --git a/pkg/coveragedb/mocks/SpannerClient.go b/pkg/coveragedb/mocks/SpannerClient.go index 516fadca7..0919b57cc 100644 --- a/pkg/coveragedb/mocks/SpannerClient.go +++ b/pkg/coveragedb/mocks/SpannerClient.go @@ -18,6 +18,14 @@ type SpannerClient struct { mock.Mock } +type SpannerClient_Expecter struct { + mock *mock.Mock +} + +func (_m *SpannerClient) EXPECT() *SpannerClient_Expecter { + return &SpannerClient_Expecter{mock: &_m.Mock} +} + // Apply provides a mock function with given fields: ctx, ms, opts func (_m *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption) (time.Time, error) { _va := make([]interface{}, len(opts)) @@ -53,11 +61,75 @@ func (_m *SpannerClient) Apply(ctx context.Context, ms []*spanner.Mutation, opts return r0, r1 } +// SpannerClient_Apply_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Apply' +type SpannerClient_Apply_Call struct { + *mock.Call +} + +// Apply is a helper method to define mock.On call +// - ctx context.Context +// - ms []*spanner.Mutation +// - opts ...spanner.ApplyOption +func (_e *SpannerClient_Expecter) Apply(ctx interface{}, ms interface{}, opts ...interface{}) *SpannerClient_Apply_Call { + return &SpannerClient_Apply_Call{Call: _e.mock.On("Apply", + append([]interface{}{ctx, ms}, opts...)...)} +} + +func (_c *SpannerClient_Apply_Call) Run(run func(ctx context.Context, ms []*spanner.Mutation, opts ...spanner.ApplyOption)) *SpannerClient_Apply_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]spanner.ApplyOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(spanner.ApplyOption) + } + } + run(args[0].(context.Context), args[1].([]*spanner.Mutation), variadicArgs...) + }) + return _c +} + +func (_c *SpannerClient_Apply_Call) Return(commitTimestamp time.Time, err error) *SpannerClient_Apply_Call { + _c.Call.Return(commitTimestamp, err) + return _c +} + +func (_c *SpannerClient_Apply_Call) RunAndReturn(run func(context.Context, []*spanner.Mutation, ...spanner.ApplyOption) (time.Time, error)) *SpannerClient_Apply_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with no fields func (_m *SpannerClient) Close() { _m.Called() } +// SpannerClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type SpannerClient_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *SpannerClient_Expecter) Close() *SpannerClient_Close_Call { + return &SpannerClient_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *SpannerClient_Close_Call) Run(run func()) *SpannerClient_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SpannerClient_Close_Call) Return() *SpannerClient_Close_Call { + _c.Call.Return() + return _c +} + +func (_c *SpannerClient_Close_Call) RunAndReturn(run func()) *SpannerClient_Close_Call { + _c.Run(run) + return _c +} + // Single provides a mock function with no fields func (_m *SpannerClient) Single() spannerclient.ReadOnlyTransaction { ret := _m.Called() @@ -78,6 +150,33 @@ func (_m *SpannerClient) Single() spannerclient.ReadOnlyTransaction { return r0 } +// SpannerClient_Single_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Single' +type SpannerClient_Single_Call struct { + *mock.Call +} + +// Single is a helper method to define mock.On call +func (_e *SpannerClient_Expecter) Single() *SpannerClient_Single_Call { + return &SpannerClient_Single_Call{Call: _e.mock.On("Single")} +} + +func (_c *SpannerClient_Single_Call) Run(run func()) *SpannerClient_Single_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *SpannerClient_Single_Call) Return(_a0 spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SpannerClient_Single_Call) RunAndReturn(run func() spannerclient.ReadOnlyTransaction) *SpannerClient_Single_Call { + _c.Call.Return(run) + return _c +} + // NewSpannerClient creates a new instance of SpannerClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewSpannerClient(t interface { diff --git a/pkg/covermerger/mocks/FileVersProvider.go b/pkg/covermerger/mocks/FileVersProvider.go index 0ff02cc07..4e07532bd 100644 --- a/pkg/covermerger/mocks/FileVersProvider.go +++ b/pkg/covermerger/mocks/FileVersProvider.go @@ -12,6 +12,14 @@ type FileVersProvider struct { mock.Mock } +type FileVersProvider_Expecter struct { + mock *mock.Mock +} + +func (_m *FileVersProvider) EXPECT() *FileVersProvider_Expecter { + return &FileVersProvider_Expecter{mock: &_m.Mock} +} + // GetFileVersions provides a mock function with given fields: targetFilePath, repoCommits func (_m *FileVersProvider) GetFileVersions(targetFilePath string, repoCommits ...covermerger.RepoCommit) (covermerger.FileVersions, error) { _va := make([]interface{}, len(repoCommits)) @@ -49,6 +57,42 @@ func (_m *FileVersProvider) GetFileVersions(targetFilePath string, repoCommits . return r0, r1 } +// FileVersProvider_GetFileVersions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFileVersions' +type FileVersProvider_GetFileVersions_Call struct { + *mock.Call +} + +// GetFileVersions is a helper method to define mock.On call +// - targetFilePath string +// - repoCommits ...covermerger.RepoCommit +func (_e *FileVersProvider_Expecter) GetFileVersions(targetFilePath interface{}, repoCommits ...interface{}) *FileVersProvider_GetFileVersions_Call { + return &FileVersProvider_GetFileVersions_Call{Call: _e.mock.On("GetFileVersions", + append([]interface{}{targetFilePath}, repoCommits...)...)} +} + +func (_c *FileVersProvider_GetFileVersions_Call) Run(run func(targetFilePath string, repoCommits ...covermerger.RepoCommit)) *FileVersProvider_GetFileVersions_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]covermerger.RepoCommit, len(args)-1) + for i, a := range args[1:] { + if a != nil { + variadicArgs[i] = a.(covermerger.RepoCommit) + } + } + run(args[0].(string), variadicArgs...) + }) + return _c +} + +func (_c *FileVersProvider_GetFileVersions_Call) Return(_a0 covermerger.FileVersions, _a1 error) *FileVersProvider_GetFileVersions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *FileVersProvider_GetFileVersions_Call) RunAndReturn(run func(string, ...covermerger.RepoCommit) (covermerger.FileVersions, error)) *FileVersProvider_GetFileVersions_Call { + _c.Call.Return(run) + return _c +} + // NewFileVersProvider creates a new instance of FileVersProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewFileVersProvider(t interface { diff --git a/pkg/gcs/mocks/Client.go b/pkg/gcs/mocks/Client.go index a6c1351ad..fff5dddd7 100644 --- a/pkg/gcs/mocks/Client.go +++ b/pkg/gcs/mocks/Client.go @@ -15,6 +15,14 @@ type Client struct { mock.Mock } +type Client_Expecter struct { + mock *mock.Mock +} + +func (_m *Client) EXPECT() *Client_Expecter { + return &Client_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with no fields func (_m *Client) Close() error { ret := _m.Called() @@ -33,6 +41,33 @@ func (_m *Client) Close() error { return r0 } +// Client_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Client_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Client_Expecter) Close() *Client_Close_Call { + return &Client_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Client_Close_Call) Run(run func()) *Client_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_Close_Call) Return(_a0 error) *Client_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Close_Call) RunAndReturn(run func() error) *Client_Close_Call { + _c.Call.Return(run) + return _c +} + // DeleteFile provides a mock function with given fields: path func (_m *Client) DeleteFile(path string) error { ret := _m.Called(path) @@ -51,6 +86,34 @@ func (_m *Client) DeleteFile(path string) error { return r0 } +// Client_DeleteFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteFile' +type Client_DeleteFile_Call struct { + *mock.Call +} + +// DeleteFile is a helper method to define mock.On call +// - path string +func (_e *Client_Expecter) DeleteFile(path interface{}) *Client_DeleteFile_Call { + return &Client_DeleteFile_Call{Call: _e.mock.On("DeleteFile", path)} +} + +func (_c *Client_DeleteFile_Call) Run(run func(path string)) *Client_DeleteFile_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Client_DeleteFile_Call) Return(_a0 error) *Client_DeleteFile_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_DeleteFile_Call) RunAndReturn(run func(string) error) *Client_DeleteFile_Call { + _c.Call.Return(run) + return _c +} + // FileExists provides a mock function with given fields: path func (_m *Client) FileExists(path string) (bool, error) { ret := _m.Called(path) @@ -79,6 +142,34 @@ func (_m *Client) FileExists(path string) (bool, error) { return r0, r1 } +// Client_FileExists_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FileExists' +type Client_FileExists_Call struct { + *mock.Call +} + +// FileExists is a helper method to define mock.On call +// - path string +func (_e *Client_Expecter) FileExists(path interface{}) *Client_FileExists_Call { + return &Client_FileExists_Call{Call: _e.mock.On("FileExists", path)} +} + +func (_c *Client_FileExists_Call) Run(run func(path string)) *Client_FileExists_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Client_FileExists_Call) Return(_a0 bool, _a1 error) *Client_FileExists_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_FileExists_Call) RunAndReturn(run func(string) (bool, error)) *Client_FileExists_Call { + _c.Call.Return(run) + return _c +} + // FileWriter provides a mock function with given fields: path, contentType, contentEncoding func (_m *Client) FileWriter(path string, contentType string, contentEncoding string) (io.WriteCloser, error) { ret := _m.Called(path, contentType, contentEncoding) @@ -109,6 +200,36 @@ func (_m *Client) FileWriter(path string, contentType string, contentEncoding st return r0, r1 } +// Client_FileWriter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FileWriter' +type Client_FileWriter_Call struct { + *mock.Call +} + +// FileWriter is a helper method to define mock.On call +// - path string +// - contentType string +// - contentEncoding string +func (_e *Client_Expecter) FileWriter(path interface{}, contentType interface{}, contentEncoding interface{}) *Client_FileWriter_Call { + return &Client_FileWriter_Call{Call: _e.mock.On("FileWriter", path, contentType, contentEncoding)} +} + +func (_c *Client_FileWriter_Call) Run(run func(path string, contentType string, contentEncoding string)) *Client_FileWriter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Client_FileWriter_Call) Return(_a0 io.WriteCloser, _a1 error) *Client_FileWriter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_FileWriter_Call) RunAndReturn(run func(string, string, string) (io.WriteCloser, error)) *Client_FileWriter_Call { + _c.Call.Return(run) + return _c +} + // ListObjects provides a mock function with given fields: path func (_m *Client) ListObjects(path string) ([]*gcs.Object, error) { ret := _m.Called(path) @@ -139,6 +260,34 @@ func (_m *Client) ListObjects(path string) ([]*gcs.Object, error) { return r0, r1 } +// Client_ListObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListObjects' +type Client_ListObjects_Call struct { + *mock.Call +} + +// ListObjects is a helper method to define mock.On call +// - path string +func (_e *Client_Expecter) ListObjects(path interface{}) *Client_ListObjects_Call { + return &Client_ListObjects_Call{Call: _e.mock.On("ListObjects", path)} +} + +func (_c *Client_ListObjects_Call) Run(run func(path string)) *Client_ListObjects_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Client_ListObjects_Call) Return(_a0 []*gcs.Object, _a1 error) *Client_ListObjects_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_ListObjects_Call) RunAndReturn(run func(string) ([]*gcs.Object, error)) *Client_ListObjects_Call { + _c.Call.Return(run) + return _c +} + // Publish provides a mock function with given fields: path func (_m *Client) Publish(path string) error { ret := _m.Called(path) @@ -157,6 +306,34 @@ func (_m *Client) Publish(path string) error { return r0 } +// Client_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish' +type Client_Publish_Call struct { + *mock.Call +} + +// Publish is a helper method to define mock.On call +// - path string +func (_e *Client_Expecter) Publish(path interface{}) *Client_Publish_Call { + return &Client_Publish_Call{Call: _e.mock.On("Publish", path)} +} + +func (_c *Client_Publish_Call) Run(run func(path string)) *Client_Publish_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Client_Publish_Call) Return(_a0 error) *Client_Publish_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Publish_Call) RunAndReturn(run func(string) error) *Client_Publish_Call { + _c.Call.Return(run) + return _c +} + // Read provides a mock function with given fields: path func (_m *Client) Read(path string) (*gcs.File, error) { ret := _m.Called(path) @@ -187,6 +364,34 @@ func (_m *Client) Read(path string) (*gcs.File, error) { return r0, r1 } +// Client_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read' +type Client_Read_Call struct { + *mock.Call +} + +// Read is a helper method to define mock.On call +// - path string +func (_e *Client_Expecter) Read(path interface{}) *Client_Read_Call { + return &Client_Read_Call{Call: _e.mock.On("Read", path)} +} + +func (_c *Client_Read_Call) Run(run func(path string)) *Client_Read_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Client_Read_Call) Return(_a0 *gcs.File, _a1 error) *Client_Read_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Read_Call) RunAndReturn(run func(string) (*gcs.File, error)) *Client_Read_Call { + _c.Call.Return(run) + return _c +} + // NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewClient(t interface { diff --git a/pkg/rpcserver/mocks/Manager.go b/pkg/rpcserver/mocks/Manager.go index 55980151d..717205338 100644 --- a/pkg/rpcserver/mocks/Manager.go +++ b/pkg/rpcserver/mocks/Manager.go @@ -20,6 +20,14 @@ type Manager struct { mock.Mock } +type Manager_Expecter struct { + mock *mock.Mock +} + +func (_m *Manager) EXPECT() *Manager_Expecter { + return &Manager_Expecter{mock: &_m.Mock} +} + // BugFrames provides a mock function with no fields func (_m *Manager) BugFrames() ([]string, []string) { ret := _m.Called() @@ -52,6 +60,33 @@ func (_m *Manager) BugFrames() ([]string, []string) { return r0, r1 } +// Manager_BugFrames_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BugFrames' +type Manager_BugFrames_Call struct { + *mock.Call +} + +// BugFrames is a helper method to define mock.On call +func (_e *Manager_Expecter) BugFrames() *Manager_BugFrames_Call { + return &Manager_BugFrames_Call{Call: _e.mock.On("BugFrames")} +} + +func (_c *Manager_BugFrames_Call) Run(run func()) *Manager_BugFrames_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Manager_BugFrames_Call) Return(leaks []string, races []string) *Manager_BugFrames_Call { + _c.Call.Return(leaks, races) + return _c +} + +func (_c *Manager_BugFrames_Call) RunAndReturn(run func() ([]string, []string)) *Manager_BugFrames_Call { + _c.Call.Return(run) + return _c +} + // CoverageFilter provides a mock function with given fields: modules func (_m *Manager) CoverageFilter(modules []*vminfo.KernelModule) ([]uint64, error) { ret := _m.Called(modules) @@ -82,6 +117,34 @@ func (_m *Manager) CoverageFilter(modules []*vminfo.KernelModule) ([]uint64, err return r0, r1 } +// Manager_CoverageFilter_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CoverageFilter' +type Manager_CoverageFilter_Call struct { + *mock.Call +} + +// CoverageFilter is a helper method to define mock.On call +// - modules []*vminfo.KernelModule +func (_e *Manager_Expecter) CoverageFilter(modules interface{}) *Manager_CoverageFilter_Call { + return &Manager_CoverageFilter_Call{Call: _e.mock.On("CoverageFilter", modules)} +} + +func (_c *Manager_CoverageFilter_Call) Run(run func(modules []*vminfo.KernelModule)) *Manager_CoverageFilter_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]*vminfo.KernelModule)) + }) + return _c +} + +func (_c *Manager_CoverageFilter_Call) Return(_a0 []uint64, _a1 error) *Manager_CoverageFilter_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Manager_CoverageFilter_Call) RunAndReturn(run func([]*vminfo.KernelModule) ([]uint64, error)) *Manager_CoverageFilter_Call { + _c.Call.Return(run) + return _c +} + // MachineChecked provides a mock function with given fields: features, syscalls func (_m *Manager) MachineChecked(features flatrpc.Feature, syscalls map[*prog.Syscall]bool) (queue.Source, error) { ret := _m.Called(features, syscalls) @@ -112,6 +175,35 @@ func (_m *Manager) MachineChecked(features flatrpc.Feature, syscalls map[*prog.S return r0, r1 } +// Manager_MachineChecked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MachineChecked' +type Manager_MachineChecked_Call struct { + *mock.Call +} + +// MachineChecked is a helper method to define mock.On call +// - features flatrpc.Feature +// - syscalls map[*prog.Syscall]bool +func (_e *Manager_Expecter) MachineChecked(features interface{}, syscalls interface{}) *Manager_MachineChecked_Call { + return &Manager_MachineChecked_Call{Call: _e.mock.On("MachineChecked", features, syscalls)} +} + +func (_c *Manager_MachineChecked_Call) Run(run func(features flatrpc.Feature, syscalls map[*prog.Syscall]bool)) *Manager_MachineChecked_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(flatrpc.Feature), args[1].(map[*prog.Syscall]bool)) + }) + return _c +} + +func (_c *Manager_MachineChecked_Call) Return(_a0 queue.Source, _a1 error) *Manager_MachineChecked_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Manager_MachineChecked_Call) RunAndReturn(run func(flatrpc.Feature, map[*prog.Syscall]bool) (queue.Source, error)) *Manager_MachineChecked_Call { + _c.Call.Return(run) + return _c +} + // MaxSignal provides a mock function with no fields func (_m *Manager) MaxSignal() signal.Signal { ret := _m.Called() @@ -132,6 +224,33 @@ func (_m *Manager) MaxSignal() signal.Signal { return r0 } +// Manager_MaxSignal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MaxSignal' +type Manager_MaxSignal_Call struct { + *mock.Call +} + +// MaxSignal is a helper method to define mock.On call +func (_e *Manager_Expecter) MaxSignal() *Manager_MaxSignal_Call { + return &Manager_MaxSignal_Call{Call: _e.mock.On("MaxSignal")} +} + +func (_c *Manager_MaxSignal_Call) Run(run func()) *Manager_MaxSignal_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Manager_MaxSignal_Call) Return(_a0 signal.Signal) *Manager_MaxSignal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Manager_MaxSignal_Call) RunAndReturn(run func() signal.Signal) *Manager_MaxSignal_Call { + _c.Call.Return(run) + return _c +} + // NewManager creates a new instance of Manager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewManager(t interface { |
