fix: enable crash detection for headful replay tests
Browse filesTwo fixes for headful crash reporting:
1. Pass /silentcrash flag in replay test mode (not just headless).
This prevents WA from spawning a separate error dialog process,
allowing the crashing process to write ERRORLOG.TXT and exit.
2. Enable file isolation (CreateFileA hook) for replay tests, not
just headless. This redirects ERRORLOG.TXT to the per-test run
directory via OPENWA_ERRORLOG_PATH, and also isolates temp files.
Previously headful crashes showed as FAIL (gameplay markers missing)
with no crash details. Now they correctly show as CRASH with full
ERRORLOG.TXT content and exception info.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
crates/openwa-dll/src/replacements/file_isolation.rs
CHANGED
|
@@ -139,8 +139,11 @@ unsafe extern "system" fn hook_create_file_a(
|
|
| 139 |
}
|
| 140 |
|
| 141 |
pub fn install() -> Result<(), String> {
|
| 142 |
-
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
| 144 |
}
|
| 145 |
|
| 146 |
unsafe {
|
|
|
|
| 139 |
}
|
| 140 |
|
| 141 |
pub fn install() -> Result<(), String> {
|
| 142 |
+
let is_test =
|
| 143 |
+
std::env::var("OPENWA_HEADLESS").is_ok() || std::env::var("OPENWA_REPLAY_TEST").is_ok();
|
| 144 |
+
|
| 145 |
+
if !is_test {
|
| 146 |
+
return Ok(()); // File isolation only active during tests
|
| 147 |
}
|
| 148 |
|
| 149 |
unsafe {
|
crates/openwa-launcher/src/main.rs
CHANGED
|
@@ -138,10 +138,11 @@ fn run() -> Result<(), String> {
|
|
| 138 |
.parent()
|
| 139 |
.ok_or("WA.exe path has no parent directory")?;
|
| 140 |
|
| 141 |
-
// In headless
|
| 142 |
-
// (SEH at 0x5A5A20) checks this flag before deciding
|
| 143 |
-
// /handlecrash — if set, it silently writes ERRORLOG.TXT
|
| 144 |
-
|
|
|
|
| 145 |
wa_args.push("/silentcrash".to_string());
|
| 146 |
}
|
| 147 |
|
|
|
|
| 138 |
.parent()
|
| 139 |
.ok_or("WA.exe path has no parent directory")?;
|
| 140 |
|
| 141 |
+
// In headless and replay-test modes, suppress WA.exe's crash dialog.
|
| 142 |
+
// The crash handler (SEH at 0x5A5A20) checks this flag before deciding
|
| 143 |
+
// to relaunch with /handlecrash — if set, it silently writes ERRORLOG.TXT
|
| 144 |
+
// and returns instead of spawning a new WA.exe for the error dialog.
|
| 145 |
+
if std::env::var("OPENWA_HEADLESS").is_ok() || std::env::var("OPENWA_REPLAY_TEST").is_ok() {
|
| 146 |
wa_args.push("/silentcrash".to_string());
|
| 147 |
}
|
| 148 |
|