testutils

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LinterTest

type LinterTest struct {
	Name    string
	Dir     string
	Expect  func(t *testing.T, report api.Report, err error)
	Options *LinterTestOptions
}

type LinterTestOptions

type LinterTestOptions struct {
	// contains filtered or unexported fields
}

func NewOptions

func NewOptions() *LinterTestOptions

func (*LinterTestOptions) DetectCQLinters

func (opts *LinterTestOptions) DetectCQLinters() *LinterTestOptions

func (*LinterTestOptions) DetectDepManagers

func (opts *LinterTestOptions) DetectDepManagers() *LinterTestOptions

func (*LinterTestOptions) DetectPythonFiles

func (opts *LinterTestOptions) DetectPythonFiles() *LinterTestOptions

func (*LinterTestOptions) UseCQLinters

func (opts *LinterTestOptions) UseCQLinters(linters []api.CQLinter) *LinterTestOptions

func (*LinterTestOptions) UseDepManagers

func (opts *LinterTestOptions) UseDepManagers(managers api.DependencyManagerList) *LinterTestOptions

func (*LinterTestOptions) UsePythonFiles

func (opts *LinterTestOptions) UsePythonFiles(files utils.Filenames) *LinterTestOptions

func (*LinterTestOptions) WithConfig

func (opts *LinterTestOptions) WithConfig(conf *config.Config) *LinterTestOptions

func (*LinterTestOptions) WithRunner added in v0.11.0

func (opts *LinterTestOptions) WithRunner(runner mllint.Runner) *LinterTestOptions

type LinterTestSuite

type LinterTestSuite struct {
	// contains filtered or unexported fields
}

func NewLinterTestSuite

func NewLinterTestSuite(linter api.Linter, tests []LinterTest) *LinterTestSuite

NewLinterTestSuite initialises a test suite for a specific linter, with a list of tests that will be executed in parallel when suite.RunAll(t) is called.

func (*LinterTestSuite) DefaultOptions

func (suite *LinterTestSuite) DefaultOptions() *LinterTestOptions

DefaultOptions returns a pointer to the options object that will be applied with every test (unless overridden by test options)

func (*LinterTestSuite) RunAll

func (suite *LinterTestSuite) RunAll(t *testing.T)

RunAll runs all tests in the suite in parallel. For each test, it creates a project with the Dir and options specified in the LinterTest. Then, it runs the linter's LintProject with that project and calls the test's Expect function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL