Skip to content

Commit 91d3e40

Browse files
committed
coverage: instrument the reanalyze library
The DUNE_INSTRUMENT_WITH change alone routed the reanalyze tests to an instrumented rescript-tools, but the reanalyze library itself declared no instrumentation backend, so its own 58 source files recorded zero coverage (only the analysis/tools code it links was counted). Add the (instrumentation (backend bisect_ppx)) stanza — matching every other analysis/* and tools/* library — so analysis/reanalyze/src is measured. Verified locally: reanalyze goes from 0 to ~61% line coverage in the report. The stanza is a no-op for normal builds (it only activates under --instrument-with / DUNE_INSTRUMENT_WITH).
1 parent 5c83ab8 commit 91d3e40

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,10 @@ coverage-lib: coverage-prepare
303303
# binary via `dune exec`, which would otherwise rebuild it *uninstrumented*.
304304
# Setting DUNE_INSTRUMENT_WITH=bisect_ppx (the env-var form of
305305
# `--instrument-with`) makes that `dune exec` match the config coverage-build
306-
# already used, so it runs the instrumented binary — no rebuild, no coverage
307-
# gap, and no de-instrumentation of the shared _build artifacts.
306+
# already used, so it runs the instrumented binary — no rebuild, no
307+
# de-instrumentation of the shared _build artifacts. (The reanalyze library
308+
# also carries its own bisect_ppx instrumentation stanza so its source is
309+
# counted, not just the analysis/tools code it links.)
308310
.PHONY: coverage-run
309311
coverage-run: coverage-lib
310312
$(COVERAGE_TEST_ENV) node scripts/test.js -all

analysis/reanalyze/src/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
(library
22
(name reanalyze)
3+
(instrumentation
4+
(backend bisect_ppx))
35
(flags
46
(-w "+6+26+27+32+33+39"))
57
(libraries reactive yojson ml str unix))

0 commit comments

Comments
 (0)