Code Coverage Reports for Elixir code.
ExCov
is a lightweight, dependency-free, drop-in replacement for the code
coverage tool that is invoked by Mix when mix test --cover
is invoked.
ExCov
supports Pluggable Reporters for integration
with external services and customized reporting.
ExCov uses pluggable reporters to print code coverage reports.
ExCov
is intentionally minimal and free of any runtime dependencies, by
default the library includes no reporters.
To be useful, you must include at least one reporter as a dependency to your project along with ExCov.
ExCov.Console
is a
good one to start with.
Add the following to your project’s mix.exs
:
def project do
[
...
test_coverage: [tool: ExCov],
preferred_cli_env: [
...
"cov": :test,
"cov.detail": :test,
...
],
...
]
end
defp deps do
[
...
{:excov, "~> 0.1", only: :test},
{:excov_reporter_console, "~> 0.1", only: :test}
...
]
end
config :excov,
:reporters, [
ExCov.Reporter.Console
]
config :excov, ExCov.Reporter.Console,
show_summary: true,
show_detail: false
To run the cover tool via the mix
command:
mix test --cover
mix cov
mix cov.detail
ExCov drew some initial ideas from ExCoveralls, thanks parroty.
ExCov is licensed under the MIT License.