Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public abstract class DumpTestBase : IDisposable
private ContractDescriptorTarget? _target;
private DumpInfo? _dumpInfo;

/// <summary>
/// The runtime version identifiers tested by <see cref="TestConfigurations"/> and
/// searched by <see cref="GetDumpSource"/>. Centralised here so both share the same list.
/// </summary>
private static readonly string[] RuntimeVersions = ["local", "net10.0"];
Comment thread
max-charlamb marked this conversation as resolved.

/// <summary>
/// The set of runtime versions and R2R modes to test against.
/// Each entry produces a separate test invocation via <c>[MemberData]</c>.
Expand All @@ -37,11 +43,11 @@ public static IEnumerable<object[]> TestConfigurations
string? dumpSource = GetDumpSource();
foreach (string r2rMode in GetR2RModes())
{
if (!IsVersionSkipped("local"))
yield return [new TestConfiguration("local", r2rMode, dumpSource)];

if (!IsVersionSkipped("net10.0"))
yield return [new TestConfiguration("net10.0", r2rMode, dumpSource)];
foreach (string version in RuntimeVersions)
{
if (!IsVersionSkipped(version))
yield return [new TestConfiguration(version, r2rMode, dumpSource)];
}
}
}
}
Expand Down Expand Up @@ -188,7 +194,7 @@ private static string GetDumpRoot()
return null;

// Try loading dump-info.json from any version directory to get OS/Arch
foreach (string versionDir in new[] { "local", "net10.0" })
foreach (string versionDir in RuntimeVersions)
{
DumpInfo? info = DumpInfo.TryLoad(Path.Combine(dumpRoot, versionDir));
if (info is not null)
Expand Down
Loading