Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reinstate devel/luacov #1209

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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