From e63ef422a4fe74bbaca10e6137e6c9277ae84254 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 8 Feb 2026 05:53:02 +0000 Subject: [PATCH] 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 --- src/cbor/dune | 4 +--- src/core/dune | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cbor/dune b/src/cbor/dune index e6d64590..0d11d1f8 100644 --- a/src/cbor/dune +++ b/src/cbor/dune @@ -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)) diff --git a/src/core/dune b/src/core/dune index bd362200..3d5622e7 100644 --- a/src/core/dune +++ b/src/core/dune @@ -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))