test: add report export to windy scenarios + fix report output path

Piston-Windy and AirBased-Windy tests now export reports via VerifyAndExportReport. ReportOutputDir path depth corrected (5->6 levels to repo root).

gitignore: reports/ already excluded.
This commit is contained in:
tian 2026-06-14 21:31:03 +08:00
parent c6aee276fb
commit 87e82727f2
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View File

@ -60,3 +60,4 @@ src/Unity/Logs/
src/Unity/UserSettings/ src/Unity/UserSettings/
unity_plugins/ unity_plugins/
nul nul
reports/

View File

@ -63,7 +63,7 @@ namespace CounterDrone.Core.Tests
} }
private static readonly string ReportOutputDir = Path.Combine( private static readonly string ReportOutputDir = Path.Combine(
AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "reports"); AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "..", "..", "..", "reports");
private static EquipmentDeployment MakeEquipment(FireUnitTemplate template, AerosolType ammoType, int quantity, double posX, double posY, double posZ) private static EquipmentDeployment MakeEquipment(FireUnitTemplate template, AerosolType ammoType, int quantity, double posX, double posY, double posZ)
{ {
@ -312,6 +312,7 @@ namespace CounterDrone.Core.Tests
msg += $" [{d.Status} hp={d.Hp:F2}]"; msg += $" [{d.Status} hp={d.Hp:F2}]";
Assert.True(launched > 0, msg); Assert.True(launched > 0, msg);
Assert.True(eng.Drones.All(d => d.Status == DroneStatus.Destroyed), msg); Assert.True(eng.Drones.All(d => d.Status == DroneStatus.Destroyed), msg);
VerifyAndExportReport(eng, eng.Drones[0]);
} }
@ -480,6 +481,7 @@ namespace CounterDrone.Core.Tests
var msg = $"AirBasedWindy: launched={launched} clouds={clouds} status={drone.Status} hp={drone.Hp:F2}"; var msg = $"AirBasedWindy: launched={launched} clouds={clouds} status={drone.Status} hp={drone.Hp:F2}";
Assert.True(launched > 0, msg); Assert.True(launched > 0, msg);
Assert.True(drone.Hp < 0.1f, msg); Assert.True(drone.Hp < 0.1f, msg);
VerifyAndExportReport(eng, drone);
} }
} }
} }