diff --git a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs index 0da34a20d74821..4b1a0a1f38f338 100644 --- a/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs +++ b/src/native/managed/cdac/tests/DumpTests/DumpTestBase.cs @@ -24,6 +24,12 @@ public abstract class DumpTestBase : IDisposable private ContractDescriptorTarget? _target; private DumpInfo? _dumpInfo; + /// + /// The runtime version identifiers tested by and + /// searched by . Centralised here so both share the same list. + /// + private static readonly string[] RuntimeVersions = ["local", "net10.0"]; + /// /// The set of runtime versions and R2R modes to test against. /// Each entry produces a separate test invocation via [MemberData]. @@ -37,11 +43,11 @@ public static IEnumerable 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)]; + } } } } @@ -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)