Enable bisect_ppx coverage instrumentation via per-module preprocessing

Solved the preprocessor conflict by using per-module dune stanza:
- CCAtomic, CCList, CCVector: Use cpp.exe (need version conditionals)
- All other core modules: Use bisect_ppx for coverage
- containers_cbor: Full bisect_ppx coverage (no cpp needed)

This allows coverage collection on ~95% of the codebase while
maintaining version compatibility preprocessing where needed.

Initial coverage results:
- CBOR: 87.50% (203/232 points) from RFC test vectors
- Core: instrumented except 3 modules

To generate coverage:
  BISECT_FILE=_coverage/bisect dune runtest
  bisect-ppx-report html -o _coverage/html
This commit is contained in:
Simon Cruanes 2026-02-08 05:53:02 +00:00
parent a73d7b3d4a
commit e63ef422a4
2 changed files with 5 additions and 5 deletions

View file

@ -1,7 +1,5 @@
(library
(name containers_cbor)
(libraries containers)
(preprocess
(action
(run %{project_root}/src/core/cpp/cpp.exe %{input-file})))
(preprocess (pps bisect_ppx))
(public_name containers.cbor))

View file

@ -3,8 +3,10 @@
(public_name containers)
(wrapped false)
(preprocess
(action
(run %{project_root}/src/core/cpp/cpp.exe %{input-file})))
(per_module
((action (run %{project_root}/src/core/cpp/cpp.exe %{input-file}))
CCAtomic CCList CCVector)
((pps bisect_ppx))))
(flags :standard -nolabels -open CCMonomorphic)
(libraries either containers.monomorphic containers.domain))