Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Laboratory ¶
type Laboratory struct {
// contains filtered or unexported fields
}
Laboratory runs each mutant in a sandbox, and keeps the sandboxes.
Building one is not cheap: it walks the whole repository and creates a symlink per file, measured at roughly 0.45ms per file. Nothing about a sandbox depends on which mutant will run in it, so rebuilding it for every mutant paid that walk once per mutant rather than once per run.
Sandboxes are pooled rather than shared, so a caller running mutants concurrently draws as many as its peak concurrency and a sequential one — which is what ditto is built for — only ever builds one. The number alive at any instant is therefore the same as when each mutant built its own, which matters because that number is also what an interrupted run leaves behind.
func New ¶
func New(testRunner TestRunner, temporaryDirectory TemporaryDirectory) *Laboratory
func (*Laboratory) Test ¶
func (l *Laboratory) Test( repository ditto.Repository, file *gomutatedfile.GoMutatedFile, ) future.Future[result.Result[string]]
type TemporaryDirectory ¶
type TemporaryDirectory interface {
New() string
}
type TestRunner ¶
type TestRunner interface {
Test(repository ditto.TemporaryRepository) result.Result[string]
}