MutagenEx.TestModuleDiscovery (mutagen_ex v0.2.0)

Copy Markdown View Source

Finds loaded ExUnit cases in the cited test files.

ExUnit consumes the registered case list on each run. Coverage, baseline, and mutation use this list to register the same cases again without compiling the files again.

Summary

Types

A case and its registration options.

ExUnit case configuration with serial execution.

Functions

Return loaded modules whose compile source is a cited path and that export __ex_unit__/0. Call after requiring the files. Entries follow the caller's file order, then compilation order within each file. Cases without a source declaration follow in module name order. A cited symlink to a case compiled under a different path returns {:error, :test_file_load_failed, details}.

Types

entry()

@type entry() :: {module(), module_cfg()}

A case and its registration options.

module_cfg()

@type module_cfg() :: %{async?: boolean(), group: term(), parameterize: [map()] | nil}

ExUnit case configuration with serial execution.

Functions

discover(files)

@spec discover([Path.t()]) :: [entry()] | {:error, :test_file_load_failed, map()}

Return loaded modules whose compile source is a cited path and that export __ex_unit__/0. Call after requiring the files. Entries follow the caller's file order, then compilation order within each file. Cases without a source declaration follow in module name order. A cited symlink to a case compiled under a different path returns {:error, :test_file_load_failed, details}.