# `Juggernaut.Result`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/result.ex#L1)

What happened to one mutant in one run (design notes §10.7, §14.1).

Statuses: `:killed`, `:survived` and `:no_coverage` are scored; `:ignored` and
`:equivalent` are not; `:compile_error` mutants never ran; `:harness_error` makes the
run exit 3; `:pending` mutants were not run (budget, `--max-mutants`, `--fail-fast`).
`kill_kind` is set only for `:killed`, and so is `test_lane`: the test lane
(`Juggernaut.TestLanes`) of the run that killed it, `:integration` when only an
integration test did (`integration_only?/1`), `nil` when no test did (a `:boot` kill)
or the result was recorded before test lanes. `reused_from` is the run id a cached result came
from; `duration_ms` is then the recorded duration of that run's job. `boots` holds the
stage clocks (ms by stage, `Juggernaut.Peer.Boot`) of each fresh boot a boot-lane job
made: the mutant's, then its own control's when it had one.

# `control`

```elixir
@type control() :: :passed | :recovered | :failed | :skipped
```

# `kill_kind`

```elixir
@type kill_kind() :: :assertion | :exception | :timeout | :crash | :boot
```

# `selection`

```elixir
@type selection() ::
  :tests | :file | :suite | :warm_first | :boot | :reconfirm | :none
```

# `status`

```elixir
@type status() ::
  :killed
  | :survived
  | :no_coverage
  | :ignored
  | :equivalent
  | :compile_error
  | :harness_error
  | :pending
```

# `t`

```elixir
@type t() :: %Juggernaut.Result{
  boots: [%{required(atom()) =&gt; non_neg_integer()}],
  control: control() | nil,
  duration_ms: non_neg_integer(),
  kill_kind: kill_kind() | nil,
  killed_by: Juggernaut.TestRef.t() | nil,
  mutant_id: String.t(),
  nearest_miss: %{test: String.t(), site_hits: pos_integer()} | nil,
  reason: String.t() | nil,
  reused_from: String.t() | nil,
  selection: selection(),
  status: status(),
  test_lane: test_lane() | nil,
  tests: [Juggernaut.TestRef.t()],
  worker: non_neg_integer() | :boot | nil
}
```

# `test_lane`

```elixir
@type test_lane() :: :unit | :integration
```

# `controls`

```elixir
@spec controls() :: [control()]
```

Every control outcome.

# `integration_only?`

```elixir
@spec integration_only?(t()) :: boolean()
```

Whether a result is a kill that only an integration test made (`test_lane:
:integration`): its unit tests all passed with the mutant on. It counts as killed.

# `kill_kinds`

```elixir
@spec kill_kinds() :: [kill_kind()]
```

Every kill kind.

# `scored?`

```elixir
@spec scored?(t() | status()) :: boolean()
```

Whether a result (or status) counts toward the score.

# `selections`

```elixir
@spec selections() :: [selection()]
```

Every selection reason.

# `statuses`

```elixir
@spec statuses() :: [status()]
```

Every status, in documentation order.

# `test_lanes`

```elixir
@spec test_lanes() :: [test_lane()]
```

Every test lane a kill can come from.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
