Documentation ¶
Index ¶
- func Analyze(t *testing.T, sourcePath string, rawData []byte)
- func InstallGolangciLint(tb testing.TB) string
- func NormalizeFileInString(in string) string
- func NormalizeFilePathInJSON(in string) string
- func SkipOnWindows(_ testing.TB)
- type RunContext
- type Runner
- type RunnerBuilder
- func (b *RunnerBuilder) Runner() *Runner
- func (b *RunnerBuilder) WithArgs(args ...string) *RunnerBuilder
- func (b *RunnerBuilder) WithBinPath(binPath string) *RunnerBuilder
- func (b *RunnerBuilder) WithCommand(command string) *RunnerBuilder
- func (b *RunnerBuilder) WithConfig(cfg string) *RunnerBuilder
- func (b *RunnerBuilder) WithConfigFile(cfgPath string) *RunnerBuilder
- func (b *RunnerBuilder) WithDirectives(sourcePath string) *RunnerBuilder
- func (b *RunnerBuilder) WithEnviron(environ ...string) *RunnerBuilder
- func (b *RunnerBuilder) WithNoConfig() *RunnerBuilder
- func (b *RunnerBuilder) WithNoParallelRunners() *RunnerBuilder
- func (b *RunnerBuilder) WithRunContext(rc *RunContext) *RunnerBuilder
- func (b *RunnerBuilder) WithTargetPath(targets ...string) *RunnerBuilder
- type RunnerResult
- func (r *RunnerResult) ExpectExitCode(possibleCodes ...int) *RunnerResult
- func (r *RunnerResult) ExpectHasIssue(issueText string) *RunnerResult
- func (r *RunnerResult) ExpectNoIssues()
- func (r *RunnerResult) ExpectOutputContains(s ...string) *RunnerResult
- func (r *RunnerResult) ExpectOutputEq(s string) *RunnerResult
- func (r *RunnerResult) ExpectOutputNotContains(s string) *RunnerResult
- func (r *RunnerResult) ExpectOutputRegexp(s string) *RunnerResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Analyze ¶
Analyze analyzes the test expectations ('want'). inspired by https://github.com/golang/tools/blob/b3b5c13b291f9653da6f31b95db100a2e26bd186/go/analysis/analysistest/analysistest.go
func InstallGolangciLint ¶
func NormalizeFileInString ¶
NormalizeFileInString it's a noop function on Unix.
func NormalizeFilePathInJSON ¶
NormalizeFilePathInJSON it's a noop function on Unix.
Types ¶
type RunContext ¶
RunContext the information extracted from directives.
func ParseTestDirectives ¶
func ParseTestDirectives(tb testing.TB, sourcePath string) *RunContext
ParseTestDirectives parses test directives from sources files.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) Run ¶
func (r *Runner) Run() *RunnerResult
type RunnerBuilder ¶
type RunnerBuilder struct {
// contains filtered or unexported fields
}
func NewRunnerBuilder ¶
func NewRunnerBuilder(tb testing.TB) *RunnerBuilder
func (*RunnerBuilder) Runner ¶
func (b *RunnerBuilder) Runner() *Runner
func (*RunnerBuilder) WithArgs ¶
func (b *RunnerBuilder) WithArgs(args ...string) *RunnerBuilder
func (*RunnerBuilder) WithBinPath ¶
func (b *RunnerBuilder) WithBinPath(binPath string) *RunnerBuilder
func (*RunnerBuilder) WithCommand ¶
func (b *RunnerBuilder) WithCommand(command string) *RunnerBuilder
func (*RunnerBuilder) WithConfig ¶
func (b *RunnerBuilder) WithConfig(cfg string) *RunnerBuilder
func (*RunnerBuilder) WithConfigFile ¶
func (b *RunnerBuilder) WithConfigFile(cfgPath string) *RunnerBuilder
func (*RunnerBuilder) WithDirectives ¶
func (b *RunnerBuilder) WithDirectives(sourcePath string) *RunnerBuilder
func (*RunnerBuilder) WithEnviron ¶
func (b *RunnerBuilder) WithEnviron(environ ...string) *RunnerBuilder
func (*RunnerBuilder) WithNoConfig ¶
func (b *RunnerBuilder) WithNoConfig() *RunnerBuilder
func (*RunnerBuilder) WithNoParallelRunners ¶
func (b *RunnerBuilder) WithNoParallelRunners() *RunnerBuilder
func (*RunnerBuilder) WithRunContext ¶
func (b *RunnerBuilder) WithRunContext(rc *RunContext) *RunnerBuilder
func (*RunnerBuilder) WithTargetPath ¶
func (b *RunnerBuilder) WithTargetPath(targets ...string) *RunnerBuilder
type RunnerResult ¶
type RunnerResult struct {
// contains filtered or unexported fields
}
func (*RunnerResult) ExpectExitCode ¶
func (r *RunnerResult) ExpectExitCode(possibleCodes ...int) *RunnerResult
func (*RunnerResult) ExpectHasIssue ¶
func (r *RunnerResult) ExpectHasIssue(issueText string) *RunnerResult
func (*RunnerResult) ExpectNoIssues ¶
func (r *RunnerResult) ExpectNoIssues()
func (*RunnerResult) ExpectOutputContains ¶
func (r *RunnerResult) ExpectOutputContains(s ...string) *RunnerResult
func (*RunnerResult) ExpectOutputEq ¶
func (r *RunnerResult) ExpectOutputEq(s string) *RunnerResult
func (*RunnerResult) ExpectOutputNotContains ¶
func (r *RunnerResult) ExpectOutputNotContains(s string) *RunnerResult
func (*RunnerResult) ExpectOutputRegexp ¶
func (r *RunnerResult) ExpectOutputRegexp(s string) *RunnerResult
ExpectOutputRegexp can be called with either a string or compiled regexp
Click to show internal directories.
Click to hide internal directories.