Skip to content

Commit 17dd8ce

Browse files
authored
Merge pull request #7 from ausimian/chore/exclude-native-from-cover
chore: exclude Emily.Native from test coverage
2 parents a9fe80b + 3988630 commit 17dd8ce

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

mix.exs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defmodule Emily.MixProject do
2121
aliases: aliases(),
2222
compilers: [:emily_mlx, :elixir_make] ++ Mix.compilers(),
2323
make_env: &make_env/0,
24+
test_coverage: test_coverage(),
2425
docs: docs(),
2526
package: package()
2627
]
@@ -40,6 +41,12 @@ defmodule Emily.MixProject do
4041
defp elixirc_paths(:test), do: ["lib", "test/support"]
4142
defp elixirc_paths(_), do: ["lib"]
4243

44+
# Emily.Native is pure NIF stubs — :erlang.load_nif/2 patches the bytecode
45+
# at load time, so the stub bodies never run and cover reports 0% on them.
46+
# Excluding the module drops that artefact and lets the remaining Elixir
47+
# coverage number mean something.
48+
defp test_coverage, do: [ignore_modules: [Emily.Native]]
49+
4350
defp deps do
4451
[
4552
{:elixir_make, "~> 0.9"},

0 commit comments

Comments
 (0)