Documentation ¶
Overview ¶
Package perturber contains the logic for the test perturber.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCInspectorNil = errors.New("compiler inspector nil")
ErrCInspectorNil occurs if the perturber constructor is passed a nil compiler inspector.
Functions ¶
Types ¶
type Kind ¶
type Kind uint8
Kind is the enumeration of kinds of perturber message.
const ( // KindStart means that the perturber is starting. // Quantities points to the perturber's quantity set. KindStart Kind = iota // KindSeedChanged means that the perturber has now changed the seed. // Seed points to the new seed. KindSeedChanged // KindSamplingCorpus means that the perturber is now sampling the corpus. // The selected corpus will be announced as a series of OnBuild messages. KindSamplingCorpus // KindRandomisingOpts means that the perturber is now randomising the compiler optimisations. // The selected compilers will be announced as a series of OnCompilerConfig messages. KindRandomisingOpts )
type Message ¶
type Message struct { // Kind is the kind of message being sent. Kind Kind // Quantities points to the quantity set on start messages. Quantities *quantity.PerturbSet // Seed points to the seed set on seed-changed messages. Seed int64 }
Message is the type of messages sent through OnPerturb.
type Observer ¶
type Observer interface { compiler.Observer builder.Observer // OnPerturb is sent when the perturber is doing something new. OnPerturb(m Message) }
Observer is the type of observers for the perturber.
type Option ¶
Option is the type of options to the Planner constructor.
func ObserveWith ¶
ObserveWith adds each observer in obs to the observer pool.
func OverrideQuantities ¶
func OverrideQuantities(qs quantity.PerturbSet) Option
OverrideQuantities overrides this planner's quantities with qs.
func UseFullCompilerIDs ¶
UseFullCompilerIDs sets whether the perturber should name compilers with their 'full ID'. By default, it preserves their original IDs.
type Perturber ¶
type Perturber struct {
// contains filtered or unexported fields
}
Perturber holds all configuration for the test perturber.