Files
OrcaSlicer/tests
Hanif Koh 5603ed66c0 Hold the POSIX Lock With flock and Leave a Moved-Aside File to the User
An fcntl lock belongs to the process and goes with the first close of
any other descriptor to the lock file, so a backup or an export walking
the data dir could drop the guard's lock without a trace. On POSIX the
guard holds a flock on its own open file instead, which nothing else in
the process can release; Windows keeps LockFileEx.

The Windows write probe opened the target for writing and took a
sharing violation for a refusal, so a file another process merely held
open was not saved at all; only a real denial refuses now, since the
rename that follows moves an open destination aside. A file moved aside
by a refused rename may be the last copy of a file or a file since
deleted on purpose, so the sweep logs it and leaves it to the user
rather than removing or restoring it. The sweep throttles itself per
directory, so a load followed by a save reads each directory once, and
the identity check on the lock file runs at most once a second, so a
scan of hundreds of presets pays for it once. A config that stays
unwritable backs off for longer with each failure in a row, and its
backup copy is written after the config, never before. The Windows
identity helper is shared with the rename that already computed it, and
the header comment that had lost its indentation and its neighbour's
description is whole again.
2026-09-25 00:27:44 +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.