Skip to content
Merged
Show file tree
Hide file tree
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 @@ -8,9 +8,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion_LatestVS)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion_LatestVS)" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion_LatestVS)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion_LatestVS)" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="$(MicrosoftCodeAnalysisAnalyzersVersion)" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/Common/external/external.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<PackageToInclude Include="CommandLineParser"/>
<PackageToInclude Include="Microsoft.DotNet.XUnitExtensions" />

<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="1.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Compilers" Version="$(MicrosoftCodeAnalysisVersion_LatestVS)" />
<PackageReference Include="CommandLineParser" Version="2.1.1-beta" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="$(TraceEventVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ public static void AssemblyDirectory_NotFound()
}

public static bool CanLoadAssemblyInSubdirectory =>
!TestLibrary.Utilities.IsNativeAot && !TestLibrary.PlatformDetection.IsMonoLLVMFULLAOT;
!TestLibrary.Utilities.IsNativeAot &&
!TestLibrary.PlatformDetection.IsMonoLLVMFULLAOT &&
!OperatingSystem.IsAndroid() &&
!OperatingSystem.IsIOS() &&
!OperatingSystem.IsTvOS() &&
!OperatingSystem.IsBrowser() &&
!OperatingSystem.IsWasi();

[ConditionalFact(nameof(CanLoadAssemblyInSubdirectory))]
public static void AssemblyDirectory_Found()
Expand Down
10 changes: 9 additions & 1 deletion src/tests/Loader/StartupHooks/StartupHookTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ public unsafe class StartupHookTests

private static delegate*<void> ProcessStartupHooks = (delegate*<void>)s_startupHookProvider.GetMethod("ProcessStartupHooks", BindingFlags.NonPublic | BindingFlags.Static).MethodHandle.GetFunctionPointer();

public static bool IsSupported = ((delegate*<bool>)s_startupHookProvider.GetProperty(nameof(IsSupported), BindingFlags.NonPublic | BindingFlags.Static).GetMethod.MethodHandle.GetFunctionPointer())();
private static bool IsUnsupportedPlatform =
// these platforms need special setup for startup hooks
OperatingSystem.IsAndroid() ||
OperatingSystem.IsIOS() ||
OperatingSystem.IsTvOS() ||
OperatingSystem.IsBrowser() ||
OperatingSystem.IsWasi();

public static bool IsSupported = !IsUnsupportedPlatform && ((delegate*<bool>)s_startupHookProvider.GetProperty(nameof(IsSupported), BindingFlags.NonPublic | BindingFlags.Static).GetMethod.MethodHandle.GetFunctionPointer())();

[Fact]
public static void ValidHookName()
Expand Down
4 changes: 2 additions & 2 deletions src/tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
<Output TaskParameter="Filtered" ItemName="TestDirs" />
</RemoveDuplicates>
<ItemGroup>
<TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/*.dll" Exclude="@(NoMonoAotAssemblyPaths)" />
<CoreRootDlls Include="$(CORE_ROOT)/*.dll" Exclude="$(CORE_ROOT)/xunit.performance.api.dll" />
<TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/**/*.dll" Exclude="@(NoMonoAotAssemblyPaths)" />
<CoreRootDlls Include="$(CORE_ROOT)/*.dll" Exclude="$(CORE_ROOT)/xunit.performance.api.dll;$(CORE_ROOT)/Microsoft.CodeAnalysis.VisualBasic.dll" />
<AllDlls Condition="'$(MonoFullAot)' == 'true'" Include="@(TestsAndAssociatedAssemblies);@(CoreRootDlls)" />
<AllDlls Condition="'$(MonoFullAot)' != 'true'" Include="@(TestsAndAssociatedAssemblies)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ private static int Main()

using (Listener listener = new())
{
CancellationTokenSource cts = new();

// Trigger the allocator task.
Task.Run(() =>
{
while (true)
while (!cts.IsCancellationRequested)
{
for (int i = 0; i < 1000; i++)
{
Expand Down Expand Up @@ -75,6 +77,8 @@ private static int Main()
}
}

cts.Cancel();

Assert2.True("listener.EventCount > 0", listener.EventCount > 0);

if (OperatingSystem.IsWindows())
Expand Down