Qlover.Tracer (qlover v0.2.2)

Copy Markdown View Source

Compiler tracer recording test-file → module reference edges for per-test-file coverage attribution.

Enable it in the host project so both library and test compilations are traced:

# mix.exs
def project do
  [...,
   elixirc_options: [tracers: [Qlover.Tracer]],
   test_elixirc_options: [tracers: [Qlover.Tracer]]]
end

(elixirc_options covers mix compile; test files are required separately by mix test, so they need test_elixirc_options.)

On every :stop event the tracer writes one record per source file to the refs dir (see default_dir/0), merging with any record already on disk, so the last write always holds the union for that file. Records are keyed by file content hash, which is what makes them safe to read across runs: the gate only trusts a record whose hash matches the file version being judged.

The tracer never breaks compilation: every failure is swallowed and reported as :ok. A missing or corrupt record only ever degrades to a full-suite fallback, never to a false pass.