paavohtl Claude Opus 4.6 (1M context) commited on
Commit
f596e2a
·
1 Parent(s): 1bdc4f7

docs: update CLAUDE.md with test isolation details and ERRORLOG env var

Browse files

Document all concurrency isolation layers (file redirection, semaphore
renaming, batched hooks, crash detection) and add OPENWA_ERRORLOG_PATH
to the environment variables section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. CLAUDE.md +14 -2
CLAUDE.md CHANGED
@@ -50,7 +50,18 @@ The `openwa-test-runner` crate (`openwa-test` binary) runs all replay tests auto
50
  .\run-tests.ps1 --no-build # skip internal DLL/launcher build
51
  ```
52
 
53
- Each test runs WA.exe in headless `/getlog` mode (pure CPU simulation, no rendering) and compares the output log byte-for-byte against an expected baseline. Tests are isolated for concurrent execution via per-PID event names, log paths, and landscape temp files (`CreateFileA` hook).
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  **IMPORTANT:** The `*_expected.log` baselines are ground truth generated from unmodified WA.exe. They must NEVER be deleted or regenerated. If a test fails, the Rust code is wrong.
56
 
@@ -73,10 +84,11 @@ Headful mode enables fast-forward (50x via DDGame+0x98B0) and runs struct valida
73
 
74
  ### Environment variables
75
 
76
- - `OPENWA_HEADLESS=1` — Headless mode: hooks MessageBoxA to auto-dismiss, launcher uses SW_HIDE, file isolation hook active
77
  - `OPENWA_VALIDATE=1` — Enable validation module (struct checks, vtable validation, memory dumps)
78
  - `OPENWA_REPLAY_TEST=1` — Fast-forward mode for headful testing (50x speed, 120s safety timeout)
79
  - `OPENWA_LOG_PATH=<path>` — Override OpenWA.log location (used by test runner for per-instance isolation)
 
80
 
81
  ### Adding new replay tests
82
 
 
50
  .\run-tests.ps1 --no-build # skip internal DLL/launcher build
51
  ```
52
 
53
+ Each test runs WA.exe in headless `/getlog` mode (pure CPU simulation, no rendering) and compares the output log byte-for-byte against an expected baseline.
54
+
55
+ **Test isolation** (all in headless mode only):
56
+ - Per-PID temp directory: `.openwa_tmp/{pid}/` for writable files (writetest.txt, mono.tmp, land.dat, landgen.svg, etc.)
57
+ - Per-PID named event: `OpenWA_HooksReady_{pid}` for launcher↔DLL synchronization
58
+ - Per-PID semaphore: `CreateSemaphoreA("Worms Armageddon")` renamed to `Worms Armageddon_{pid}`
59
+ - Per-PID log paths via `OPENWA_LOG_PATH` and `OPENWA_ERRORLOG_PATH` env vars
60
+ - Per-PID playback.thm via `replay.rs` (written by Rust, read by WA's MapView::Load)
61
+ - WA.exe crash dialog suppressed via `/silentcrash` command-line flag
62
+ - Batched MinHook enables: all hooks use `queue_enable_hook` + single `apply_queued()` call
63
+
64
+ **Crash detection**: Tests that crash show `CRASH` (not `FAIL`) with NTSTATUS name and ERRORLOG.TXT content. ERRORLOG.TXT is redirected to the per-test run directory via `OPENWA_ERRORLOG_PATH`.
65
 
66
  **IMPORTANT:** The `*_expected.log` baselines are ground truth generated from unmodified WA.exe. They must NEVER be deleted or regenerated. If a test fails, the Rust code is wrong.
67
 
 
84
 
85
  ### Environment variables
86
 
87
+ - `OPENWA_HEADLESS=1` — Headless mode: hooks MessageBoxA to auto-dismiss, launcher uses SW_HIDE, file isolation hook active, semaphore renamed per-PID
88
  - `OPENWA_VALIDATE=1` — Enable validation module (struct checks, vtable validation, memory dumps)
89
  - `OPENWA_REPLAY_TEST=1` — Fast-forward mode for headful testing (50x speed, 120s safety timeout)
90
  - `OPENWA_LOG_PATH=<path>` — Override OpenWA.log location (used by test runner for per-instance isolation)
91
+ - `OPENWA_ERRORLOG_PATH=<path>` — Redirect ERRORLOG.TXT to specified path (used by test runner for crash capture)
92
 
93
  ### Adding new replay tests
94