-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBattleModels.cs
More file actions
80 lines (52 loc) · 2.42 KB
/
Copy pathBattleModels.cs
File metadata and controls
80 lines (52 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
namespace XISOSharp.BattleTests;
/// <summary>Outcome of a single battle op.</summary>
internal enum BattleStatus
{
Passed,
Failed,
Skipped,
}
/// <summary>Result of one op (list/extract/rewrite) for one ISO. <see cref="Seconds"/>
/// is the combined op wall time; <see cref="CliSeconds"/>/<see cref="OracleSeconds"/>
/// are the per-executable times measured by the harness.</summary>
internal sealed record SubResult(
string Op,
BattleStatus Status,
string Detail,
double Seconds,
double CliSeconds,
double OracleSeconds);
/// <summary>Per-ISO battle result across all requested ops.</summary>
internal sealed class IsoResult
{
public required string FilePath { get; init; }
public required string FileName { get; init; }
public required long FileSize { get; init; }
public double Seconds { get; set; }
public List<SubResult> Subs { get; } = [];
public bool HasFailures => Subs.Any(static s => s.Status == BattleStatus.Failed);
public bool AllPassed => Subs.Count > 0 && Subs.All(static s => s.Status == BattleStatus.Passed);
}
/// <summary>Aggregated session state for reporting.</summary>
internal sealed class BattleSession
{
public int Seed { get; init; }
public string CliPath { get; set; } = string.Empty;
public string OraclePath { get; set; } = string.Empty;
public string CliVersion { get; set; } = string.Empty;
public string OracleVersion { get; set; } = string.Empty;
public string XdvdfsPath { get; set; } = string.Empty;
public string XdvdfsVersion { get; set; } = "not found";
public string XboxkitPath { get; set; } = string.Empty;
public string XboxkitVersion { get; set; } = "not found";
public string WorkRoot { get; set; } = string.Empty;
public List<string> Ops { get; init; } = [];
public TimeSpan Elapsed { get; set; }
public List<IsoResult> IsoResults { get; } = [];
public int TotalIsos => IsoResults.Count;
public int FailedIsos => IsoResults.Count(static r => r.HasFailures);
public int TotalSubs => IsoResults.Sum(static r => r.Subs.Count);
public int PassedSubs => IsoResults.Sum(static r => r.Subs.Count(static s => s.Status == BattleStatus.Passed));
public int FailedSubs => IsoResults.Sum(static r => r.Subs.Count(static s => s.Status == BattleStatus.Failed));
public int SkippedSubs => IsoResults.Sum(static r => r.Subs.Count(static s => s.Status == BattleStatus.Skipped));
}