Skip to content

Commit

Permalink
Merge pull request #1209 from myk002/myk_luacov
Browse files Browse the repository at this point in the history
reinstate devel/luacov
  • Loading branch information
myk002 authored Jun 27, 2024
2 parents c145987 + 68ec3e1 commit 0b65a49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Template for new versions:
- `fix/occupancy`: fixes issues where you can't build somewhere because the game tells you an item/unit/building is in the way but there's nothing there
- `fix/sleepers`: (reinstated) fixes sleeping units belonging to a camp that never wake up.
- `timestream`: (reinstated) keep the game running quickly even when there are large numbers of units on the map
- `devel/luacov`: (reinstated) add Lua script coverage reporting for use in testing and performance analysis

## New Features
- `buildingplan`: dimension tooltip is now displayed for constructions and buildings that are designated over an area, like bridges and farm plots
Expand Down
13 changes: 7 additions & 6 deletions docs/devel/luacov.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ devel/luacov

.. dfhack-tool::
:summary: Lua script coverage report generator.
:tags: unavailable
:tags: dev

This script generates a coverage report from collected statistics. By default it
reports on every Lua file in all of DFHack. To filter filenames, specify one or
Expand All @@ -16,16 +16,17 @@ Statistics are cumulative across reports. That is, if you run a report, run a
lua script, and then run another report, the report will include all activity
from the first report plus the recently run lua script. Restarting DFHack will
clear the statistics. You can also clear statistics after running a report by
passing the --clear flag to this script.
passing the ``--clear`` flag to this script.

Note that the coverage report will be empty unless you have started DFHack with
the "DFHACK_ENABLE_LUACOV=1" environment variable defined, which enables the
coverage monitoring.

Also note that enabling both coverage monitoring and lua profiling via the
"profiler" module can produce strange results. Their interceptor hooks override
each other. Usage of the "kill-lua" command will likewise override the luacov
interceptor hook and may prevent coverage statistics from being collected.
Also note that enabling coverage monitoring and lua profiling (via the
"profiler" module) at the same time can produce strange results. Their
interceptor hooks conflict with each other. Usage of the `kill-lua` command will
likewise override the luacov interceptor hook and may prevent coverage
statistics from being collected.

Usage
-----
Expand Down

0 comments on commit 0b65a49

Please sign in to comment.