Expand description
GDScript coverage instrumentation.
Inserts Gdt._cov_hit("res://path", line) before each executable line
inside function bodies. Uses gdsyntax to identify function body line
ranges; blank lines and comment lines are skipped via text heuristics.
The caller is responsible for backing up original files before writing the instrumented bytes and restoring them after the test run.
Functions§
- instrument_
file - Instrument a GDScript source file for coverage tracking.
Returns
(instrumented_bytes, instrumented_line_numbers).instrumented_line_numbersis the set of 1-based line numbers that received a hit-tracking call — this is the “lines found” (LF) count for LCOV. - instrument_
source - Instrument raw GDScript bytes. Returns
(instrumented_bytes, instrumented_lines).