report

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package report formats and outputs mutation testing results.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFilter = errors.New("invalid statuses filter, only 'lctkvsr' letters allowed")

ErrInvalidFilter is returned when an invalid status filter string is provided.

Functions

func Do

func Do(results Results) error

Do generates the report of the Results received. This function uses the log package in gremlins to write to the chosen io.Writer, so it is necessary to call log.Init before the report generation.

func Mutant

func Mutant(m mutator.Mutator)

Mutant logs a mutator.Mutator. It reports the mutant.Status, the mutator.Type and its position. This function uses the log package in gremlins to write to the chosen io.Writer, so it is necessary to call log.Init before the report generation.

Types

type Filter added in v0.5.1

type Filter = map[mutator.Status]struct{}

Filter maps mutation statuses to filter which mutants are logged.

func ParseFilter added in v0.5.1

func ParseFilter(s string) (Filter, error)

ParseFilter parses a status filter string into a Filter map. Valid characters are 'lctkvsr' representing different mutation statuses.

type MutantLogger added in v0.5.1

type MutantLogger struct {
	Filter
}

MutantLogger prints mutant statuses based on filter and verbosity flags.

func NewLogger added in v0.5.1

func NewLogger() MutantLogger

NewLogger creates a new MutantLogger with filters from configuration.

func (MutantLogger) Mutant added in v0.5.1

func (l MutantLogger) Mutant(m mutator.Mutator)

Mutant logs a mutant if it passes the filter.

type Results

type Results struct {
	Module  string
	Mutants []mutator.Mutator
	Elapsed time.Duration
}

Results contains the list of mutator.Mutator to be reported and the time it took to discover and test them.

Directories

Path Synopsis
Package internal provides data structures for the Gremlins JSON output format.
Package internal provides data structures for the Gremlins JSON output format.

Jump to

Keyboard shortcuts

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