Skip to content

test: add coverage for autobutcher, misery, seedwatch, logistics, suspendmanager - #5928

Open
Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:test-plugin-coverage
Open

Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:test-plugin-coverage

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

Adds in-engine test files for five plugins that previously had no coverage:

  • autobutcher: command parsing for all subcommands, race lists, all/new keywords, and every invalid-input path (target counts, missing races, unrecognized commands).
  • misery: status/clear/factor setters via the CLI path, factor below-minimum rejection, and status output text.
  • seedwatch: all/single-plant targets, clear, fractional target flooring, unknown plant names, and missing/negative target rejection.
  • logistics: enable/disable autoretrain roundtrip, unknown feature rejection, add/clear stockpile configs on a real stockpile, totals accounting in getStockpileData, and now (guarded so it only runs when no configs can designate items).
  • suspendmanager: foreach_construction_job and runOnce/unsuspend_command unsuspension against a real constructed building, isBuildingPlanJob/isKeptSuspended, and the SuspendOverlay building-tracking/viewport logic plus the no-selection paths of the status/toggle overlays.

All state-mutating tests snapshot and restore in config.wrapper finalizers (seed targets, stockpile configs, job suspend flags, dfhack.onStateChange hooks, constructed buildings).

Test plan

  • test -t plugins/autobutcher,plugins/misery,plugins/seedwatch,plugins/logistics,plugins/suspendmanager: 47/47 tests, 227/227 checks pass
  • Re-run on mutated fort state: still 47/47
  • Full main-repo fortress suite: 58/58 tests, 265/265 checks pass
  • Full scripts-repo fortress suite: 23/23 tests, 132/132 checks pass

…pendmanager

Exercise plugin command parsing, config read/write paths, and overlay
state logic in-engine. Tests that mutate state (seed targets, stockpile
configs, job suspend flags, onStateChange hooks) snapshot and restore it
in wrappers so the fort is left untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant