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
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.IO;
using Xunit;

namespace System.Reflection.Tests
Expand All @@ -22,11 +23,10 @@ public void GetModuleVersionId_HasModuleVersionId_BehaveConsistently()
}
}

// This calls Assembly.Load, but xUnit turn is into a LoadFrom because TinyAssembly is just a Content item in the project.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))]
public void GetModuleVersionId_KnownAssembly_ReturnsExpected()
{
Module module = Assembly.Load(new AssemblyName("TinyAssembly")).ManifestModule;
Module module = Assembly.LoadFrom(Path.Combine(AppContext.BaseDirectory, "TinyAssembly.dll")).ManifestModule;
Assert.True(module.HasModuleVersionId());
if (!(PlatformDetection.IsMonoRuntime && PlatformDetection.IsAppleMobile && PlatformDetection.IsBuiltWithAggressiveTrimming))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,13 @@
<Delete Files="$(OutDir)System.Runtime.Loader.Test.BindFailure.Locked.dll" />
<Delete Files="$(OutDir)System.Runtime.Loader.Test.BindFailure.Corrupt.dll" />
</Target>

<Target Name="RemoveBindFailureTestAssembliesFromReadyToRunPublish"
Condition="'$(TestReadyToRun)' == 'true'"
AfterTargets="Publish"
BeforeTargets="ZipTestArchive">
<Delete Files="$(BundleDir)System.Runtime.Loader.Test.BindFailure.Missing.dll" />
<Delete Files="$(BundleDir)System.Runtime.Loader.Test.BindFailure.Locked.dll" />
<Delete Files="$(BundleDir)System.Runtime.Loader.Test.BindFailure.Corrupt.dll" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public void GetEntryAssembly()
string assembly = Assembly.GetEntryAssembly().ToString();

bool correct;
if (PlatformDetection.IsNativeAot)
if (PlatformDetection.IsNativeAot || PlatformDetection.IsReadyToRunCompiled)
{
// The single file test runner is not 'xunit.console'.
correct = assembly.IndexOf("System.Reflection.Tests", StringComparison.OrdinalIgnoreCase) != -1;
Expand Down
13 changes: 1 addition & 12 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -655,19 +655,8 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Numerics.Tensors\tests\System.Numerics.Tensors.Tests.csproj" Condition="'$(TargetArchitecture)' == 'x64'" />
</ItemGroup>

<!--
There is a decent number of hidden tests that fail with TestReadyToRun, and
it's proven to be a neverending task to flush all of them at once. So, we will
start by only enabling the tests we have confirmed work correctly, and we will
gradually enable the rest in subsequent PR's.

Tracking Issue for this work item: https://github.com/dotnet/runtime/issues/95928
-->
<ItemGroup Condition="'$(TestReadyToRun)' == 'true'">
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime/tests/System.Reflection.Tests/System.Reflection.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.TypeExtensions/tests/System.Reflection.TypeExtensions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader/tests/DefaultContext/System.Runtime.Loader.DefaultContext.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader/tests/System.Runtime.Loader.Tests.csproj" />
<!-- https://github.com/dotnet/runtime/issues/95928 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj" />

<!-- https://github.com/dotnet/runtime/issues/129832 -->
Expand Down
Loading