Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ protected TestApp UpdateAppConfigForTest(TestApp app, TestSetup setup, bool copy
return app;
}

// The fallback RID is a compile-time define for the host. On Windows, it is always win10 and on
// other platforms, it matches the build RID (non-portable for source-builds, portable otherwise)
private static string FallbackRid = OperatingSystem.IsWindows()
? $"win10-{RepoDirectoriesProvider.Default.BuildArchitecture}"
: RepoDirectoriesProvider.Default.BuildRID;

protected const string UnknownRid = "unknown-rid";

private const string LinuxAssembly = "linux/LinuxAssembly.dll";
Expand Down Expand Up @@ -168,6 +174,18 @@ public void RidSpecificAssembly_CurrentRid(string rid, bool hasRuntimeFallbacks,
excludedPath);
}

[Fact]
public void RidSpecificAssembly_FallbackRid()
{
// When there is no RID graph and the host is configured to use the RID graph, it should still be able to
// resolve an exact match to the fallback RID
string assetPath = $"{FallbackRid}/{FallbackRid}Asset";
RunTest(
p => p.WithAssemblyGroup(FallbackRid, g => g.WithAsset(assetPath)),
new TestSetup() { Rid = null, HasRidGraph = false, UseRidGraph = true },
new ResolvedPaths() { IncludedAssemblyPaths = assetPath });
}

[Theory]
[InlineData(true)]
[InlineData(false)]
Expand Down Expand Up @@ -255,6 +273,18 @@ public void RidSpecificNativeLibrary_CurrentRid(string rid, bool hasRuntimeFallb
excludedPath);
}

[Fact]
public void RidSpecificNativeLibrary_FallbackRid()
{
// When there is no RID graph and the host is configured to use the RID graph, it should still be able to
// resolve an exact match to the fallback RID
string assetPath = $"{FallbackRid}/{FallbackRid}Asset";
RunTest(
p => p.WithNativeLibraryGroup(FallbackRid, g => g.WithAsset(assetPath)),
new TestSetup() { Rid = null, HasRidGraph = false, UseRidGraph = true },
new ResolvedPaths() { IncludedNativeLibraryPaths = $"{FallbackRid}/" });
}

[Theory]
[InlineData(true)]
[InlineData(false)]
Expand Down