Files
OrcaSlicer/tests
Lam Wei Lun 6839c9d344 Invalidate filament grouping when the AMS material inventory changes (#17195)
Print::m_extruder_filament_info feeds filament grouping, but it was a plain
member with no change detection and no invalidation entry point. Changing only
the device-side AMS material inventory, such as a spool colour, therefore left
a finished slice valid: Print::apply() reported UNCHANGED, the grouping steps
stayed done, and export re-emitted the previous G-code with a stale
filament_map.

Compare the inventory in Print::apply() and invalidate the grouping steps when
it changed:

- set_extruder_filament_info() now only stashes the payload, so apply() can
  compare it against the installed one and act on the change under the state
  lock.
- The comparison projects both payloads exactly as grouping does: colour, type,
  tray name, support flag and filament id per tray. Volatile AMS keys such as
  remaining amount, temperatures and filament_changed therefore do not count.
- A changed inventory invalidates psWipeTower and psSkirtBrim, matching what
  extruder_ams_count already does, and escalates to APPLY_STATUS_INVALIDATED
  only when a step was actually taken back.
- A payload carrying no tray configs at all is treated as "not known yet"
  rather than "no filaments", so an AMS reconnect does not invalidate a
  finished slice, while clearing the last spool still does.
- The Plater hands the inventory to apply() before applying, so the change
  rides the same pass.

Adds comparator tests for the inventory projection and an integration test that
drives process() and apply() over a two-extruder auto-match print.
2026-11-04 21:45:25 +08:00
..
2025-12-08 22:42:11 +08:00

OrcaSlicer tests

Building, running and writing tests is documented on the wiki, under How to Test.

Two files here rather than there, because coding agents only read what is in the repository:

  • AGENTS.md is the same guidance in short form, and is what an agent working under tests/ picks up.
  • CATCH2.md is the Catch2 reference, including the mistakes that break a test at runtime.