Repository navigation
Commit b8a6089
authored
Include gentype, analysis and syntax tests in coverage (rescript-lang#8467)
* coverage: include gentype and analysis test suites
The coverage suite previously only ran `node scripts/test.js -all`
(mocha/build/ounit/docstrings), leaving compiler/gentype and the whole
analysis/ tree uninstrumented in the report.
Run the additional suites under the same BISECT_FILE env so their
instrumented binaries accumulate counters:
- gentype tests compile via the instrumented bsc in BIN_DIR
- analysis tests run the instrumented rescript-editor-analysis
- tools tests run the instrumented rescript-tools (links analysis +
reanalyze)
Use the analysis suite's test-analysis-binary target rather than its
full test: the reanalyze tests invoke the binary via `dune exec`, which
rebuilds it uninstrumented and strips instrumentation from the shared
_build artifacts, so they produce no coverage and would corrupt the
build for later suites.
* coverage: include syntax tests
The syntax suite (scripts/test_syntax.sh) is a merge-gating test on all
platforms but contributed no coverage: it drives the res_parser binary,
which is instrumented (it carries the bisect_ppx stanza and links the
instrumented compiler/syntax lib) and is invoked from
_build/install/default/bin, the same pattern as the analysis tests.
Run it under BISECT_FILE so compiler/syntax is no longer a blind spot.
ROUNDTRIP_TEST=1 matches Linux CI and also exercises the printer paths.
* coverage: include reanalyze tests via DUNE_INSTRUMENT_WITH
The reanalyze tests invoke rescript-tools through `dune exec`, so they
ran an uninstrumented binary and produced no coverage (and a plain
`dune exec` would rebuild the shared _build artifacts uninstrumented).
Set DUNE_INSTRUMENT_WITH=bisect_ppx (the env-var form of
`--instrument-with`) for the analysis suite so that `dune exec` matches
the instrumentation config coverage-build already used. dune finds the
build up to date, runs the instrumented binary, and reanalyze now
contributes coverage for analysis/reanalyze without any test-script
changes. Switch the analysis line from test-analysis-binary to the full
test target to pull reanalyze in.
* 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).
* Update changelog1 parent 6a18567 commit b8a6089
3 files changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
240 | 246 | | |
241 | 247 | | |
242 | 248 | | |
| |||
253 | 259 | | |
254 | 260 | | |
255 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
256 | 266 | | |
257 | 267 | | |
258 | 268 | | |
| |||
278 | 288 | | |
279 | 289 | | |
280 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
281 | 310 | | |
282 | 311 | | |
283 | | - | |
284 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
285 | 318 | | |
286 | 319 | | |
287 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
0 commit comments