laboratory

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 5 Imported by: 0

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

type TemporaryDirectory

type TemporaryDirectory interface {
	New() string
}

type TestRunner

type TestRunner interface {
	Test(repository ditto.TemporaryRepository) result.Result[string]
}

Jump to

Keyboard shortcuts

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