Documentation
¶
Index ¶
- Constants
- func ApplySchemataInMemory(src []byte, filePath string, fset *token.FileSet, fileMutants []*Mutant) (*ast.File, error)
- func ApplySchemataToAST(fileAST *ast.File, fset *token.FileSet, filePath string, src []byte, ...) (map[int]PositionMapping, error)
- func ApplySchemataToFile(filePath string, fileMutants []*Mutant) (map[int]PositionMapping, error)
- func CopyDir(src, dst string) error
- func FindGoModDir(dir string) string
- func GetTotalMutants() int
- func InjectSchemataHelpers(fileToMutants map[string][]*Mutant, log *logger.Logger) error
- func LogPreflightResults(log *logger.Logger, totalMutants int, results []PreflightResult, ...)
- func MakeSelfContained(tempDir string) error
- func ResolveCache(mutants []Mutant, baseDir string, c *cache.Cache) (toRun []int, fileHashes map[string]string, err error)
- func RewriteImports(_ string) error
- func RunPreflight(mutants []Mutant, log *logger.Logger) ([]Mutant, []PreflightResult)
- func SaveCache(mutants []Mutant, baseDir string, c *cache.Cache, fileHashes map[string]string)
- func SetGoVersion(version string)
- func UniqueErrorLines(output string, skipPrefix string) []string
- type CompilerError
- type ModuleWorkspace
- type Mutant
- type MutantSite
- type PositionMapping
- type PreflightResult
- type ProgressTracker
Constants ¶
View Source
const ( StatusValid = "valid" StatusInvalid = "invalid" StatusCompileError = "error" )
Variables ¶
This section is empty.
Functions ¶
func ApplySchemataInMemory ¶
func ApplySchemataInMemory(src []byte, filePath string, fset *token.FileSet, fileMutants []*Mutant) (*ast.File, error)
ApplySchemataInMemory applies schemata to a fresh parse of src and returns the mutated AST without any disk I/O. Used by preflight type-checking.
func ApplySchemataToAST ¶
func ApplySchemataToFile ¶
func ApplySchemataToFile(filePath string, fileMutants []*Mutant) (map[int]PositionMapping, error)
func FindGoModDir ¶
func GetTotalMutants ¶
func GetTotalMutants() int
func InjectSchemataHelpers ¶
func LogPreflightResults ¶
func LogPreflightResults(log *logger.Logger, totalMutants int, results []PreflightResult, validCount int)
LogPreflightResults prints a summary of filtered mutants.
func MakeSelfContained ¶
func ResolveCache ¶
func RewriteImports ¶
func RunPreflight ¶
func RunPreflight(mutants []Mutant, log *logger.Logger) ([]Mutant, []PreflightResult)
RunPreflight validates all mutants with three-level filtering.
Level 1 — fast static checks (nil node/file, obviously unsafe) Level 2 — schemata AST integrity (can format.Node produce output?) Level 3 — go/types type-check of the schemata-transformed code
Level 3 catches type errors (wrong inferred types, scope leaks from := wrapping, blanked imports) before the workspace build step.
func SetGoVersion ¶
func SetGoVersion(version string)
SetGoVersion allows overriding the detected Go version (for testing or config).
func UniqueErrorLines ¶
Types ¶
type CompilerError ¶
func ParseCompilerErrors ¶
func ParseCompilerErrors(output string) []CompilerError
type ModuleWorkspace ¶
type ModuleWorkspace struct {
TempDir string
// contains filtered or unexported fields
}
func NewModuleWorkspace ¶
func NewModuleWorkspace() (*ModuleWorkspace, error)
func (*ModuleWorkspace) Cleanup ¶
func (w *ModuleWorkspace) Cleanup()
type Mutant ¶
type Mutant struct {
ID int
Site engine.Site
Operator mutator.Operator
TempDir string
TempLine int
TempCol int
Status string
Error error
KilledBy string
KillDuration time.Duration
KillOutput string
ErrorReason string
}
func GenerateAndRunSchemata ¶
func GenerateAndRunSchemata(ctx context.Context, sites []engine.Site, operators []mutator.Operator, allOps []mutator.Operator, baseDir string, projectRoot string, dirRules []config.DirOperatorRule, resolver *subconfig.Resolver, concurrent int, cache *cache.Cache, tests []string, testPaths []string, log *logger.Logger, progbar bool, unitTestsEnabled bool, externalCfg config.ExternalSuitesConfig, cfg *config.Config) ([]Mutant, error)
type MutantSite ¶
type PositionMapping ¶
type PreflightResult ¶
type ProgressTracker ¶
type ProgressTracker struct {
// contains filtered or unexported fields
}
func NewProgressTracker ¶
func NewProgressTracker(total int) *ProgressTracker
func (*ProgressTracker) Finish ¶
func (p *ProgressTracker) Finish()
func (*ProgressTracker) Record ¶
func (p *ProgressTracker) Record()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.