Ensures DynamicFacade-shimmed modules retain :cover instrumentation.
When ExCoverall or :cover compiles a module with coverage instrumentation,
DynamicFacade.setup/1 renames the on-disk (non-instrumented) bytecode to
Module.__dd_original__, stripping coverage from the backup. This module
preserves coverage by:
- Exporting pre-shim coverdata
- Re-instrumenting the backup via
:cover.compile_beams/1 - Providing
merge/1to rewrite backup coverdata back to the original name
Summary
Functions
Merge coverdata from the __dd_original__ backup into the original module name.
Merge coverdata for all registered DynamicFacade modules.
Functions
Merge coverdata from the __dd_original__ backup into the original module name.
Exports coverdata for Module.__dd_original__, rewrites all module-name
references back to Module, imports the result, and cleans up the temp file.
Call this after all tests have completed to ensure ExCoverall sees coverage for DynamicFacade-shimmed modules under their original names.
Merge coverdata for all registered DynamicFacade modules.
Iterates all modules set up via DynamicFacade.setup/1 and calls
merge/1 for each. No-op if :cover is not available or has no
instrumented modules.
Call this from test/test_helper.exs after all tests complete:
ExUnit.after_suite(fn _ -> DoubleDown.DynamicFacade.Cover.merge_all() end)