# `MutagenEx.Test.CoverFacade`
[🔗](https://github.com/iautom8things/mutagen_ex/blob/v0.2.0/lib/mutagen_ex/test/cover_facade.ex#L1)

Behaviour for the OTP `:cover` test seam used by
`MutagenEx.CoverageRunner`.

Production code talks to the `:cover` Erlang module (lifted from
`lib/tools-*/ebin` on first use); the facade exists so tests can swap
a fake recording stub and assert on the lifecycle (start, compile,
analyse, stop) without touching the real cover_server.

## Default

`MutagenEx.Test.Cover` delegates to `:cover`.

# `analyse_result`

```elixir
@type analyse_result() ::
  {:ok, [{{module(), pos_integer()}, {non_neg_integer(), non_neg_integer()}}]}
  | {:error, term()}
```

Result of `:cover.analyse/3` with `:coverage` + `:line`.

# `compile_beam_result`

```elixir
@type compile_beam_result() :: {:ok, module()} | {:error, term()}
```

Result of `:cover.compile_beam/1`.

# `start_result`

```elixir
@type start_result() :: {:ok, pid()} | {:error, {:already_started, pid()}} | term()
```

Result of `:cover.start/0`.

# `analyse`

```elixir
@callback analyse(module :: module(), type :: atom(), granularity :: atom()) ::
  analyse_result()
```

Analyse coverage for an instrumented module. Mirrors
`:cover.analyse(module, :coverage, :line)`.

# `compile_beam`

```elixir
@callback compile_beam(path :: charlist()) :: compile_beam_result()
```

Instrument a `.beam` for coverage. Mirrors `:cover.compile_beam/1`.

`path` is the charlist returned by `:code.which/1`; the runner does
the conversion at the call site.

# `start`

```elixir
@callback start() :: start_result()
```

Start the cover_server. Mirrors `:cover.start/0`.

# `stop`

```elixir
@callback stop() :: any()
```

Stop the cover_server. Mirrors `:cover.stop/0`.

---

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