models

package
v0.0.0-...-f7b6625 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutation

type Mutation struct {
	// Change is called before executing the exec command.
	Change func()
	// Reset is called after executing the exec command.
	Reset func()
}

Mutation defines the behavior of one mutation.

type MutationResult

type MutationResult int
const (
	ResultMutantEscaped MutationResult = iota
	ResultMutantKilled
	ResultMutantSkipped
	ResultEmpty
)

func GetResultStatus

func GetResultStatus(err error) (MutationResult, error)

type MutationStats

type MutationStats struct {
	MutantsEscaped int
	MutantsKilled  int
	MutantsSkipped int
	Duplicated     int
	UnknownResults int
}

func (MutationStats) Score

func (ms MutationStats) Score() float64

func (MutationStats) Total

func (ms MutationStats) Total() int

type Mutator

type Mutator func(pkg *types.Package, info *types.Info, node ast.Node) []Mutation

Mutator defines a mutator for mutation testing by returning a list of possible mutations for the given node.

type MutatorItem

type MutatorItem struct {
	Name    MutatorName
	Mutator Mutator
}

func GetMutators

func GetMutators(ml MutatorsInterface, disabledMutators []MutatorName) []MutatorItem

type MutatorName

type MutatorName string

func (MutatorName) String

func (n MutatorName) String() string

type MutatorsInterface

type MutatorsInterface interface {
	Register(name MutatorName, mutator Mutator) error
	GetByName(name MutatorName) (Mutator, error)
	Names() []MutatorName
}

type MutatorsList

type MutatorsList []MutatorItem

func (MutatorsList) GetByName

func (ml MutatorsList) GetByName(name MutatorName) (Mutator, error)

GetByName returns a new mutator instance given the registered name of the mutator. The error return argument is not nil, if the name does not exist in the registered mutator list.

func (MutatorsList) Names

func (ml MutatorsList) Names() []MutatorName

Names returns a list of all registered mutator names.

func (*MutatorsList) Register

func (ml *MutatorsList) Register(name MutatorName, mutator Mutator) error

Register registers a mutator instance function with the given name.

type MutatorsMap

type MutatorsMap map[MutatorName]Mutator

func (MutatorsMap) GetByName

func (ml MutatorsMap) GetByName(name MutatorName) (Mutator, error)

GetByName returns a new mutator instance given the registered name of the mutator. The error return argument is not nil, if the name does not exist in the registered mutator list.

func (MutatorsMap) Names

func (ml MutatorsMap) Names() []MutatorName

Names returns a list of all registered mutator names.

func (*MutatorsMap) Register

func (ml *MutatorsMap) Register(name MutatorName, mutator Mutator) error

Register registers a mutator instance function with the given name.

type Options

type Options struct {
	General struct {
		Debug                bool
		DoNotRemoveTmpFolder bool
		Verbose              bool
		FailOnly             bool
	} `group:"General Options"`
	Files struct {
		Blacklist []string
		ListFiles bool
		PrintAST  bool
	} `group:"File Options"`
	Mutator struct {
		AvailableMutators []MutatorName
		DisableMutators   []MutatorName
		ListMutators      bool
	} `group:"Mutator Options"`
	Filter struct {
		Match string
	} `group:"Filter Options"`
	Exec struct {
		Exec    string
		NoExec  bool
		Timeout int64
		Jobs    int
	} `group:"Exec Options"`
	Test struct {
		Recursive bool
		Score     float64
	} `group:"Test Options"`
	Remaining struct {
		Targets []string
	}
}

Jump to

Keyboard shortcuts

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