Mutare.Result (mutare v0.1.1)

Copy Markdown View Source

The outcome of running the suite against one mutant.

Summary

Functions

Returns whether status counts as a killed mutant.

Returns whether a mutant launched a test run.

Returns whether status counts in the mutation-score denominator.

Types

status()

@type status() ::
  :killed
  | :survived
  | :no_coverage
  | :timeout
  | :atom_exhausted
  | :ignored
  | :poisoned
  | :harness_error

t()

@type t() :: %Mutare.Result{
  duration_ms: non_neg_integer() | nil,
  exit_status: non_neg_integer() | nil,
  output: String.t() | nil,
  site: Mutare.Site.t(),
  status: status()
}

Functions

kill?(status)

@spec kill?(status()) :: boolean()

Returns whether status counts as a killed mutant.

:killed, :timeout, and :atom_exhausted count as kills.

Examples

iex> Mutare.Result.kill?(:killed)
true
iex> Mutare.Result.kill?(:survived)
false

ran?(status)

@spec ran?(status()) :: boolean()

Returns whether a mutant launched a test run.

:no_coverage, :ignored, and :poisoned never start a test run. :harness_error does start one and is included here.

Examples

iex> Mutare.Result.ran?(:harness_error)
true
iex> Mutare.Result.ran?(:ignored)
false

scored?(status)

@spec scored?(status()) :: boolean()

Returns whether status counts in the mutation-score denominator.

:no_coverage, :ignored, :poisoned, and :harness_error are excluded because they do not produce a test-suite verdict for the mutation.

Examples

iex> Enum.filter(Mutare.Result.Status.names(), &Mutare.Result.scored?/1)
[:killed, :timeout, :atom_exhausted, :survived]