execution

package
v0.0.0-...-d340977 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package execution provides mutation testing execution functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine handles test execution using overlay-based mutation.

func New

func New() (*Engine, error)

New creates a new execution engine.

func (*Engine) Close

func (e *Engine) Close() error

Close cleans up the execution engine.

func (*Engine) RunMutations

func (e *Engine) RunMutations(mutants []mutation.Mutant) ([]mutation.Result, error)

RunMutations executes tests for all mutants in parallel.

func (*Engine) RunMutationsWithOptions

func (e *Engine) RunMutationsWithOptions(mutants []mutation.Mutant, workers, timeout int) ([]mutation.Result, error)

RunMutationsWithOptions executes tests for all mutants in parallel with custom options.

type MutationContext

type MutationContext struct {
	OriginalPath string // Absolute path to the original file
	MutatedPath  string // Path to the mutated file in temp directory
	OverlayPath  string // Path to the overlay.json file
	MutantDir    string // Directory containing this mutant's files
}

MutationContext holds the context for a single mutation execution.

type OverlayConfig

type OverlayConfig struct {
	Replace map[string]string `json:"Replace"` //nolint:tagliatelle // Go overlay spec requires "Replace"
}

OverlayConfig represents the JSON structure for go build/test -overlay option. Note: "Replace" must be capitalized as per Go's overlay specification.

type OverlayMutator

type OverlayMutator struct {
	// contains filtered or unexported fields
}

OverlayMutator manages overlay-based mutation without modifying original files.

func NewOverlayMutator

func NewOverlayMutator() (*OverlayMutator, error)

NewOverlayMutator creates a new overlay-based mutator.

func (*OverlayMutator) Cleanup

func (om *OverlayMutator) Cleanup() error

Cleanup removes all temporary files.

func (*OverlayMutator) CleanupMutation

func (om *OverlayMutator) CleanupMutation(ctx *MutationContext) error

CleanupMutation removes temporary files for a single mutation.

func (*OverlayMutator) PrepareMutation

func (om *OverlayMutator) PrepareMutation(mutant mutation.Mutant) (*MutationContext, error)

PrepareMutation prepares the mutation execution by creating mutated file and overlay.json.

Jump to

Keyboard shortcuts

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