Skip to content

Commit a63754d

Browse files
committed
Add test
1 parent c89fb64 commit a63754d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using Xunit;
6+
7+
[ConditionalClass(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))]
8+
public unsafe class ExternalAssemblyProbe
9+
{
10+
[Fact]
11+
[SkipOnMono("External assembly probe via host-runtime contract is not implemented")]
12+
public static void ExternalAppAssemblies()
13+
{
14+
// In order to get to this point, the runtime must have been able to find the app assemblies
15+
// Check that the TPA is indeed empty - that is, the runtime is not relying on that property.
16+
string tpa = AppContext.GetData("TRUSTED_PLATFORM_ASSEMBLIES") as string;
17+
Assert.True(string.IsNullOrEmpty(tpa), "TRUSTED_PLATFORM_ASSEMBLIES should be empty");
18+
}
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<!-- Needed for CLRTestEnvironmentVariable -->
4+
<RequiresProcessIsolation>true</RequiresProcessIsolation>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<Compile Include="ExternalAssemblyProbe.cs" />
8+
9+
<CLRTestEnvironmentVariable Include="APP_ASSEMBLIES" Value="EXTERNAL" />
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ProjectReference Include="$(TestLibraryProjectPath)" />
13+
</ItemGroup>
14+
</Project>

0 commit comments

Comments
 (0)