From 21fabd2679027ee76ada363bc447c8cba3a058bd Mon Sep 17 00:00:00 2001 From: OEVG <950+oevg@noreply.octowow.st> Date: Sat, 31 Oct 2026 21:33:43 +0000 Subject: [PATCH] Add tests README and run_all.sh Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_019W3rwtugSE5NbbiWQCbbKX --- tests/README.md | 21 +++++++++++++++++++++ tests/run_all.sh | 13 +++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/README.md create mode 100644 tests/run_all.sh diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..e81b8cf --- /dev/null +++ b/tests/README.md @@ -0,0 +1,21 @@ +# Tests + +Plain Lua 5.0 scripts with stubbed game functions. Run them from the +repository root; the game never loads them. + + tests/run_all.sh # all tests, uses lua5.0 + tests/run_all.sh lua # all tests, other interpreter + +Single test: `lua5.0 tests/test_stock.lua GentleGC.lua` + +| File | Covers | +|------|--------| +| test_stock.lua | stock Lua 5.0 collector | +| test_factor.lua | the client's 1.25x collector rule | +| test_threshold.lua | threshold handling | +| test_combat_auto.lua | automatic collections in combat | +| test_raid.lua | careful mode, other addons' collections, garbage rate | +| test_hitch.lua | freeze detector | +| test_classicapi.lua | ClassicAPI client mod | +| test_weirdperf.lua | weirdperformance.dll collector | +| test_memory.lua | per-addon memory (also needs `!!!!GentleGC_Memory/GentleGC_Memory.lua` as the second argument) | diff --git a/tests/run_all.sh b/tests/run_all.sh new file mode 100644 index 0000000..ab648e7 --- /dev/null +++ b/tests/run_all.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Runs every test against GentleGC.lua. Usage: tests/run_all.sh [lua-binary] +# Run from the repository root. Default interpreter is lua5.0. +LUA="${1:-lua5.0}" +fail=0 +for t in tests/test_*.lua; do + echo "== $t" + case "$t" in + *test_memory.lua) "$LUA" "$t" GentleGC.lua "!!!!GentleGC_Memory/GentleGC_Memory.lua" || fail=1 ;; + *) "$LUA" "$t" GentleGC.lua || fail=1 ;; + esac +done +exit $fail