testbed: stop destroying the player's save
The documented way to run the testbed began with
rm -rf ~/AppData/Roaming/LOVE/Alchemist
which is the player's actual playthrough. It was written down as the
official procedure in four places, so every run of the test suite ate a
real save -- including twice in the session that produced the previous
commit. Reported by Talon.
The testbed does genuinely need an empty save directory: it drives a new
game from the main menu through the prologue, which has already happened
in any real save. So tests/run-testbed.sh MOVES the save aside (never
deletes it), runs, discards the test run's directory and moves the real
one back. Restore is on an EXIT trap plus INT/TERM, so it also happens on
a failed run, a crash and Ctrl-C. If the restore itself fails it says so
loudly and leaves the backup on disk rather than pressing on.
This cannot live inside the mod: love.load calls config.initialize,
keybindings.initialize and user.initialize long before main.lua reaches
require("accessibility").initialize(), so by the time any of our Lua runs
the save directory has already been read. The swap has to happen around
the process.
The rm -rf is removed from all four docs that carried it, each replaced
with the script and the reason not to clear that directory by hand --
being written down as procedure is what made it recur.
accessibility/.gitattributes forces LF on *.sh, or a Windows checkout
hands bash a \r and the script dies. It sits inside accessibility/ on
purpose: a top-level one would show up in the game-file footprint check,
which still reads `main.lua | 1 +`.
Verified with a marker file in a populated save directory: 38 checks, 0
failures, marker intact, no leftover backup directories.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0df3842bf1
commit
c841bcc68d
@@ -0,0 +1,7 @@
|
||||
# Per-directory .gitattributes, kept inside accessibility/ deliberately: a
|
||||
# top-level one would show up in the game-file footprint check
|
||||
# (git diff --stat vanilla-0.4.2 ...), which must stay at `main.lua | 1 +`.
|
||||
#
|
||||
# Shell scripts must keep LF endings even on Windows checkouts: bash fails with
|
||||
# "\r: command not found" on CRLF, which would break tests/run-testbed.sh.
|
||||
*.sh text eol=lf
|
||||
Reference in New Issue
Block a user