diff --git a/docs/workflow/testing/libraries/testing-wasm.md b/docs/workflow/testing/libraries/testing-wasm.md index bc6965cd5dc4e4..4906192c6c1600 100644 --- a/docs/workflow/testing/libraries/testing-wasm.md +++ b/docs/workflow/testing/libraries/testing-wasm.md @@ -144,6 +144,56 @@ At the moment supported values are: By default, `chrome` browser is used. +## CoreCLR ReadyToRun library tests + +Build the browser CoreCLR runtime, libraries, packs, and host crossgen2 first: + +```bash +./build.sh clr+libs+host+packs -os browser -c Release /p:AotHostArchitecture=arm64 /p:AotHostOS=osx +``` + +Use the architecture and OS of the build machine for `AotHostArchitecture` and `AotHostOS` +(for example, `x64` and `linux` on an x64 Linux host). +On macOS, ensure a supported Python installation is ahead of Xcode's Python on `PATH`. + +Run a library suite with trimmed ReadyToRun images: + +```bash +XHARNESS_COMMAND=test-browser ./dotnet.sh build /t:Test \ + src/libraries/System.Runtime/tests/System.IO.UnmanagedMemoryStream.Tests/System.IO.UnmanagedMemoryStream.Tests.csproj \ + /p:TargetOS=browser /p:TargetArchitecture=wasm /p:RuntimeFlavor=CoreCLR /p:Configuration=Release \ + /p:TestWasmReadyToRun=true /p:EnableAggressiveTrimming=true \ + /p:Scenario=WasmTestOnChrome /p:InstallChromeForTests=true +``` + +`TestWasmReadyToRun` enables `PublishReadyToRun` only in browser CoreCLR library test projects. +Do not pass `PublishReadyToRun=true` globally to `build.sh`: that also attempts to publish +host-side build tools with ReadyToRun. +`EnableAggressiveTrimming` selects the shared mobile test trimming configuration, including +the xUnit and test-utility descriptors and trimming-aware test exclusions. +Library-specific descriptors retain their existing platform conditions; Apple-only roots +are not enabled for browser tests. The property must also be passed when building the test utilities. +R2R browser test apps also set `TEST_READY_TO_RUN_MODE=1`, so existing +`PlatformDetection.IsReadyToRunCompiled` conditions apply. Quarantines for shared WebAssembly +R2R issues use `PlatformDetection.IsWasmReadyToRun`, covering browser and WASI R2R while +leaving interpreter coverage enabled on both hosts. + +For the existing CoreCLR library smoke set, use: + +```bash +XHARNESS_COMMAND=test-browser ./build.sh libs.tests -test -os browser -c Release \ + /p:RuntimeFlavor=CoreCLR /p:TestWasmReadyToRun=true /p:EnableAggressiveTrimming=true \ + /p:RunSmokeTestsOnly=true /p:Scenario=WasmTestOnChrome /p:InstallChromeForTests=true +``` + +Omit `RunSmokeTestsOnly` to build and run all supported library suites. To isolate trimming +from R2R, keep `EnableAggressiveTrimming=true` and pass `PublishReadyToRun=false`. +Use clean project-specific `bin` and `obj` browser-wasm outputs when switching modes; +stale staged assets can otherwise cause assembly-loading failures before tests start. + +The `LibraryTestsCoreCLR_R2R` CI jobs use the same configuration and archive the published +tests for execution on Helix. The existing interpreter jobs remain separate. + ## AOT library tests - Building library tests with AOT, and (even) with `EnableAggressiveTrimming` takes 3-9mins on CI, and that adds up for all the assemblies, causing diff --git a/eng/pipelines/common/templates/wasm-coreclr-library-tests.yml b/eng/pipelines/common/templates/wasm-coreclr-library-tests.yml index 61bb488f777113..f723450db55e3a 100644 --- a/eng/pipelines/common/templates/wasm-coreclr-library-tests.yml +++ b/eng/pipelines/common/templates/wasm-coreclr-library-tests.yml @@ -6,9 +6,13 @@ parameters: isWasmOnlyBuild: false nameSuffix: '' platforms: [] + readyToRun: false scenarios: ['WasmTestOnChrome'] shouldContinueOnError: false shouldRunSmokeOnly: false + # Default matches the fast interpreter lane. The R2R lane trims and crossgen2-publishes + # every test app, which is substantially slower, so its callers raise this. + timeoutInMinutes: 240 useHelixMonitor: false jobs: @@ -77,13 +81,18 @@ jobs: value: /p:InstallV8ForTests=true ${{ else }}: value: '' + - name: wasmReadyToRunArgs + ${{ if eq(parameters.readyToRun, true) }}: + value: /p:TestWasmReadyToRun=true /p:EnableAggressiveTrimming=true + ${{ else }}: + value: '' jobParameters: isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} testGroup: innerloop nameSuffix: LibraryTestsCoreCLR${{ parameters.nameSuffix }} - buildArgs: -s clr+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) $(chromeInstallArg) $(firefoxInstallArg) $(v8InstallArg) /maxcpucount:1 ${{ parameters.extraBuildArgs }} - timeoutInMinutes: 240 + buildArgs: -s clr+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) $(chromeInstallArg) $(firefoxInstallArg) $(v8InstallArg) $(wasmReadyToRunArgs) ${{ parameters.extraBuildArgs }} + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} # if !alwaysRun, then: # if this is runtime-wasm (isWasmOnlyBuild): # - then run only if it would not have run on default pipelines (based @@ -98,7 +107,7 @@ jobs: - template: /eng/pipelines/libraries/helix.yml parameters: creator: dotnet-bot - testRunNamePrefixSuffix: CoreCLR_$(_BuildConfig) - extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) ${{ parameters.extraHelixArguments }} + testRunNamePrefixSuffix: CoreCLR${{ parameters.nameSuffix }}_$(_BuildConfig) + extraHelixArguments: /p:BrowserHost=$(_hostedOs) $(_wasmRunSmokeTestsOnlyArg) $(wasmReadyToRunArgs) ${{ parameters.extraHelixArguments }} scenarios: ${{ parameters.scenarios }} useHelixMonitor: ${{ parameters.useHelixMonitor }} diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index 0dfb371196d872..798b775a8f13a7 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -80,6 +80,22 @@ jobs: scenarios: - WasmTestOnChrome + # CoreCLR ReadyToRun library tests, complementary to the default pipeline's lane. + - template: /eng/pipelines/common/templates/wasm-coreclr-library-tests.yml + parameters: + platforms: + - browser_wasm + nameSuffix: _R2R + readyToRun: true + timeoutInMinutes: 480 + extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} + isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} + alwaysRun: ${{ parameters.isWasmOnlyBuild }} + useHelixMonitor: ${{ parameters.useHelixMonitor }} + scenarios: + - WasmTestOnChrome + # Library tests with full threading - template: /eng/pipelines/common/templates/wasm-library-tests.yml parameters: diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 74c90c04774dc9..f41e63fbf85ef6 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1271,6 +1271,20 @@ extends: scenarios: - WasmTestOnChrome + # WebAssembly CoreCLR with trimmed ReadyToRun library tests + - template: /eng/pipelines/common/templates/wasm-coreclr-library-tests.yml + parameters: + platforms: + - browser_wasm + alwaysRun: ${{ variables.isRollingBuild }} + nameSuffix: _R2R + readyToRun: true + timeoutInMinutes: 480 + extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + useHelixMonitor: ${{ variables.enableHelixJobMonitor }} + scenarios: + - WasmTestOnChrome + # WebAssembly CoreCLR - smoke tests only on Firefox and V8 - template: /eng/pipelines/common/templates/wasm-coreclr-library-tests.yml parameters: diff --git a/eng/testing/ILLink.Descriptor.xunit.xml b/eng/testing/ILLink.Descriptor.xunit.xml index 78ee4cddc3246a..6ab8003bbec88f 100644 --- a/eng/testing/ILLink.Descriptor.xunit.xml +++ b/eng/testing/ILLink.Descriptor.xunit.xml @@ -16,6 +16,9 @@ + + + diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets index 0276d1a0ec8aea..a2eae35f007daf 100644 --- a/eng/testing/tests.browser.targets +++ b/eng/testing/tests.browser.targets @@ -100,6 +100,10 @@ true + + + + false @@ -382,7 +386,7 @@ - + diff --git a/eng/testing/tests.wasi.targets b/eng/testing/tests.wasi.targets index 9a591156932b1f..c9242792ecc76e 100644 --- a/eng/testing/tests.wasi.targets +++ b/eng/testing/tests.wasi.targets @@ -151,7 +151,7 @@ Condition="'%(WasmFilesToIncludeFromPublishDir.Identity)' != ''" /> - + diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets index 63a30b0f8a6741..dff8304d5266bc 100644 --- a/eng/testing/tests.wasm.targets +++ b/eng/testing/tests.wasm.targets @@ -122,7 +122,7 @@ - + value; + } + + private sealed class DerivedVirtualTarget : VirtualTarget + { + public override int Transform(int value) => value + 1; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static int CallVirtual(VirtualTarget target, int value) => target.Transform(value); + [MethodImpl(MethodImplOptions.NoInlining)] public static async Task MultipleAwaits() { - int x = 1; + int x = CallVirtual(new DerivedVirtualTarget(), 0); await Task.Yield(); x++; await Task.Yield(); diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCasesRunner/R2RResultChecker.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCasesRunner/R2RResultChecker.cs index eef9655dc30ae7..54324b56d65ef3 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCasesRunner/R2RResultChecker.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCasesRunner/R2RResultChecker.cs @@ -872,6 +872,119 @@ public static bool AsyncMethodsWithResumptionStubsAreAdjacent(ReadyToRunReader r return true; } + /// + /// Returns true if each Wasm async resume target uses the RuntimeFunctions index immediately + /// following its parent async method and its funclets. + /// + public static bool WasmAsyncResumeTargetsMatchRuntimeFunctionOrder(ReadyToRunReader reader, out string diagnostic) + { + var failures = new List(); + var resumptionStubTargets = new HashSet(); + var storeMultiTargets = new List<(string Owner, uint Target)>(); + int checkedMethodCount = 0; + + foreach (ReadyToRunMethod method in GetAllMethods(reader)) + { + if (method.Fixups is null) + continue; + + bool foundResumptionStub = false; + foreach (FixupCell cell in method.Fixups) + { + ReadyToRunImportSection importSection = reader.ImportSections[(int)cell.TableIndex]; + ReadyToRunImportSection.ImportSectionEntry entry = importSection.Entries[(int)cell.CellOffset]; + ReadyToRunFixupKind? kind = entry.Signature?.FixupKind; + if (kind is not (ReadyToRunFixupKind.ResumptionStubEntryPoint or ReadyToRunFixupKind.StoreMultiCallableAddrOfCode)) + continue; + + int offset = reader.GetOffset(checked((int)entry.SignatureRVA)) + sizeof(byte); + uint targetIndex = BinaryPrimitives.ReadUInt32LittleEndian(reader.Image.AsSpan(offset, sizeof(uint))); + + if (kind == ReadyToRunFixupKind.StoreMultiCallableAddrOfCode) + { + storeMultiTargets.Add((method.SignatureString, targetIndex)); + continue; + } + + foundResumptionStub = true; + resumptionStubTargets.Add(targetIndex); + uint expectedIndex = checked((uint)(method.EntryPointRuntimeFunctionId + method.RuntimeFunctionCount - 1)); + if (targetIndex != expectedIndex) + { + failures.Add( + $"'{method.SignatureString}' has {kind} target {targetIndex}; " + + $"expected RuntimeFunctions index {expectedIndex}."); + } + } + + if (foundResumptionStub) + checkedMethodCount++; + } + + foreach ((string owner, uint target) in storeMultiTargets) + { + if (!resumptionStubTargets.Contains(target)) + { + failures.Add( + $"'{owner}' has StoreMultiCallableAddrOfCode target {target}, " + + "which is not registered by a ResumptionStubEntryPoint fixup."); + } + } + + if (checkedMethodCount == 0) + { + diagnostic = "No methods with ResumptionStubEntryPoint fixups were found."; + return false; + } + + if (storeMultiTargets.Count == 0) + { + diagnostic = "No StoreMultiCallableAddrOfCode fixups were found."; + return false; + } + + if (!HasWasmVirtualDispatchThunk(reader)) + { + diagnostic = "No virtual-dispatch thunk was found."; + return false; + } + + diagnostic = failures.Count == 0 + ? $"Found {checkedMethodCount} async method(s) and {storeMultiTargets.Count} StoreMultiCallableAddrOfCode fixup(s) whose resume targets match RuntimeFunctions ordering in an image containing a virtual-dispatch thunk." + : string.Join(Environment.NewLine, failures); + return failures.Count == 0; + } + + private static bool HasWasmVirtualDispatchThunk(ReadyToRunReader reader) + { + foreach (ReadyToRunImportSection section in reader.ImportSections) + { + if (section.Entries is null) + continue; + + foreach (ReadyToRunImportSection.ImportSectionEntry entry in section.Entries) + { + if (entry.Signature?.FixupKind != ReadyToRunFixupKind.InjectStringThunks) + continue; + + int offset = reader.GetOffset(checked((int)entry.SignatureRVA)) + sizeof(byte); + while (reader.Image[offset] != 0) + { + int terminator = reader.Image.AsSpan(offset).IndexOf((byte)0); + if (terminator < 0) + return false; + + if (reader.Image[offset] == (byte)'V') + return true; + + offset += terminator + 1 + sizeof(uint); + } + } + } + + return false; + } + /// /// Returns true if the R2R image contains at least one ContinuationLayout fixup. /// diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/WasmVirtualDispatchThunkNode.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/WasmVirtualDispatchThunkNode.cs index 18318aedb3e4ff..233897cdefb077 100644 --- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/WasmVirtualDispatchThunkNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/WasmVirtualDispatchThunkNode.cs @@ -56,7 +56,8 @@ protected override string GetName(NodeFactory factory) return sb.ToString(); } - public override int ClassCode => 115732791; + // Keep virtual dispatch thunks after compiled methods and the existing Wasm transition thunks. + public override int ClassCode => 948271451; public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) { diff --git a/src/libraries/Common/tests/System/GenericMathTestMemberData.cs b/src/libraries/Common/tests/System/GenericMathTestMemberData.cs index 6e29ad5e95b6fd..0cceb281ef407b 100644 --- a/src/libraries/Common/tests/System/GenericMathTestMemberData.cs +++ b/src/libraries/Common/tests/System/GenericMathTestMemberData.cs @@ -1373,7 +1373,8 @@ public static IEnumerable MaxDouble yield return new object[] { double.NaN, double.PositiveInfinity, double.NaN }; yield return new object[] { double.NaN, double.NegativeInfinity, double.NaN }; // [ActiveIssue("https://github.com/dotnet/runtime/issues/133311")] - if (!(PlatformDetection.IsMonoRuntime && PlatformDetection.IsWasm)) + // [ActiveIssue("https://github.com/dotnet/runtime/issues/134268")] + if (!((PlatformDetection.IsMonoRuntime && PlatformDetection.IsWasm) || PlatformDetection.IsWasmReadyToRun)) { yield return new object[] { PositiveNaNDouble, -0.0, PositiveNaNDouble }; yield return new object[] { -0.0, NegativeNaNDouble, NegativeNaNDouble }; @@ -1577,7 +1578,8 @@ public static IEnumerable MinDouble yield return new object[] { double.NaN, double.PositiveInfinity, double.NaN }; yield return new object[] { double.NaN, double.NegativeInfinity, double.NaN }; // [ActiveIssue("https://github.com/dotnet/runtime/issues/133311")] - if (!(PlatformDetection.IsMonoRuntime && PlatformDetection.IsWasm)) + // [ActiveIssue("https://github.com/dotnet/runtime/issues/134268")] + if (!((PlatformDetection.IsMonoRuntime && PlatformDetection.IsWasm) || PlatformDetection.IsWasmReadyToRun)) { yield return new object[] { PositiveNaNDouble, -0.0, PositiveNaNDouble }; yield return new object[] { -0.0, NegativeNaNDouble, NegativeNaNDouble }; diff --git a/src/libraries/Common/tests/TestUtilities/System/AdminHelpers.cs b/src/libraries/Common/tests/TestUtilities/System/AdminHelpers.cs index 6c523ce7803123..40c08a17247583 100644 --- a/src/libraries/Common/tests/TestUtilities/System/AdminHelpers.cs +++ b/src/libraries/Common/tests/TestUtilities/System/AdminHelpers.cs @@ -32,17 +32,21 @@ public static int RunAsSudo(string commandLine) } } + [DllImport("libc", SetLastError = true)] + internal static extern unsafe uint geteuid(); + public static unsafe bool IsProcessElevated() { - // Browser does not have the concept of an elevated process - if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"))) + // Browser and WASI do not have the concept of an elevated process + if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")) || + RuntimeInformation.IsOSPlatform(OSPlatform.Create("WASI"))) { return false; } if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - uint userId = Interop.Sys.GetEUid(); + uint userId = geteuid(); return(userId == 0); } diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 7e352915ac39e3..47db2845b1777b 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -276,6 +276,7 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly() public static bool IsSingleFile => !HasAssemblyFiles; public static bool IsReadyToRunCompiled => Environment.GetEnvironmentVariable("TEST_READY_TO_RUN_MODE") == "1"; + public static bool IsWasmReadyToRun => IsWasm && IsReadyToRunCompiled; private static volatile Tuple s_lazyNonZeroLowerBoundArraySupported; public static bool IsNonZeroLowerBoundArraySupported diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index dbe74e9c4c4330..daf748565b0c78 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -1,4 +1,12 @@ + + + true + <_TestWasmReadyToRunImplicit>true + + @@ -271,4 +279,11 @@ $(MSBuildProjectName)-project + + + + + diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs index 30045000c0c345..e426ccf42c3a32 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs @@ -271,6 +271,7 @@ public void CreateCallSite_UsesLongestResolvableConstructorWhenDeclaredAfterShor } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134266", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public void CreateCallSite_Throws_IfClosedTypeDoesNotSatisfyStructGenericConstraint() { // Arrange @@ -285,6 +286,7 @@ public void CreateCallSite_Throws_IfClosedTypeDoesNotSatisfyStructGenericConstra } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134266", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public void CreateCallSite_ReturnsService_IfClosedTypeSatisfiesStructGenericConstraint() { // Arrange @@ -329,6 +331,7 @@ public void CreateCallSite_ReturnsService_IfClosedTypeSatisfiesClassGenericConst } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134266", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public void CreateCallSite_Throws_IfClosedTypeDoesNotSatisfyNewGenericConstraint() { // Arrange @@ -343,6 +346,7 @@ public void CreateCallSite_Throws_IfClosedTypeDoesNotSatisfyNewGenericConstraint } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134266", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public void CreateCallSite_ReturnsService_IfClosedTypeSatisfiesNewGenericConstraint() { // Arrange @@ -528,6 +532,7 @@ public void CreateCallSite_ReturnsMatchingTypes_IfClosedTypeSatisfiesBaseClassCo [InlineData(typeof(IFakeOpenGenericService), default(int), new[] { typeof(FakeOpenGenericService), typeof(ClassWithStructConstraint), typeof(ClassWithNewConstraint), typeof(ClassWithSelfReferencingConstraint) })] [InlineData(typeof(IFakeOpenGenericService), "", new[] { typeof(FakeOpenGenericService), typeof(ClassWithClassConstraint), typeof(ClassWithInterfaceConstraint), typeof(ClassWithSelfReferencingConstraint) })] [InlineData(typeof(IFakeOpenGenericService), new[] { 1, 2, 3 }, new[] { typeof(FakeOpenGenericService), typeof(ClassWithClassConstraint), typeof(ClassWithInterfaceConstraint) })] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134266", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public void CreateCallSite_ReturnsMatchingTypesThatMatchCorrectConstraints(Type closedServiceType, object value, Type[] matchingImplementationTypes) { // Arrange diff --git a/src/libraries/System.Composition/tests/ILLink.Descriptors.xml b/src/libraries/System.Composition/tests/ILLink.Descriptors.xml new file mode 100644 index 00000000000000..b61c6e44c2e3eb --- /dev/null +++ b/src/libraries/System.Composition/tests/ILLink.Descriptors.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Composition/tests/System.Composition.Tests.csproj b/src/libraries/System.Composition/tests/System.Composition.Tests.csproj index c15bf8613b019c..33925f630beb20 100644 --- a/src/libraries/System.Composition/tests/System.Composition.Tests.csproj +++ b/src/libraries/System.Composition/tests/System.Composition.Tests.csproj @@ -39,6 +39,9 @@ + + + diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketReceiveErrorMessageTests.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketReceiveErrorMessageTests.cs index 5ef6f7ded22568..b195fb0316949b 100644 --- a/src/libraries/System.Net.WebSockets/tests/WebSocketReceiveErrorMessageTests.cs +++ b/src/libraries/System.Net.WebSockets/tests/WebSocketReceiveErrorMessageTests.cs @@ -8,6 +8,7 @@ namespace System.Net.WebSockets.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/134264", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public class WebSocketReceiveErrorMessageTests { // The test WebSocket is created with isServer:false, so received frames must NOT be masked diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj index 33e1e4ce93627d..8d182f09d26576 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/System.Reflection.MetadataLoadContext.Tests.csproj @@ -104,4 +104,13 @@ + + + + + + + diff --git a/src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs b/src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs index 9c4eb3000ae8b6..a624f1e248abfa 100644 --- a/src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs +++ b/src/libraries/System.Runtime/tests/System.Dynamic.Runtime.Tests/Dynamic.DynamicType/Conformance.dynamic.dynamicType.basic.cs @@ -751,6 +751,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.basic.array public class Program { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134265", typeof(System.PlatformDetection), nameof(System.PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(System.PlatformDetection.IsBrowser))] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod()); @@ -846,6 +847,7 @@ namespace ManagedTests.DynamicCSharp.Conformance.dynamic.dynamicType.basic.array public class Program { [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134265", typeof(System.PlatformDetection), nameof(System.PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(System.PlatformDetection.IsBrowser))] public static void DynamicCSharpRunTest() { Assert.Equal(0, MainMethod()); diff --git a/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs b/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs index 8bef5a6a799bb3..ff9a5d3a1613a9 100644 --- a/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Reflection.Tests/AssemblyTests.cs @@ -154,7 +154,11 @@ public void GetEntryAssembly() string assembly = Assembly.GetEntryAssembly().ToString(); bool correct; - if (PlatformDetection.IsNativeAot || PlatformDetection.IsReadyToRunCompiled) + if (PlatformDetection.IsWasmReadyToRun) + { + correct = assembly.IndexOf("WasmTestRunner", StringComparison.OrdinalIgnoreCase) != -1; + } + else if (PlatformDetection.IsNativeAot || PlatformDetection.IsReadyToRunCompiled) { // The single file test runner is not 'xunit.console'. correct = assembly.IndexOf("System.Reflection.Tests", StringComparison.OrdinalIgnoreCase) != -1; @@ -956,6 +960,7 @@ public static void AssemblyGetForwardedTypes() [ActiveIssue("https://github.com/dotnet/runtime/issues/69919", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] [ActiveIssue("https://github.com/dotnet/runtime/issues/77821", TestPlatforms.Android)] [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134263", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public static void AssemblyGetForwardedTypesLoadFailure() { Assembly a = typeof(TypeInForwardedAssembly).Assembly; diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj index e62c619d9c1bf9..4dcede7eb71324 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System.Runtime.Tests.csproj @@ -375,7 +375,7 @@ - + diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DelegateTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DelegateTests.cs index 6494af3a1341cd..7486fdd6641030 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DelegateTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/DelegateTests.cs @@ -48,6 +48,7 @@ private static void EmptyFunc() { } public delegate TestStruct StructReturningDelegate(); [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/133618", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public static void ClosedStaticDelegate() { TestClass foo = new TestClass(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/InvokeWithRefLikeArgs.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/InvokeWithRefLikeArgs.cs index 2a405457004e56..2470d4bda343f9 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/InvokeWithRefLikeArgs.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/InvokeWithRefLikeArgs.cs @@ -38,6 +38,7 @@ public static void MethodTakesRefStructAsArgWithDefaultValue_ThrowsNSE() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [SkipOnMono("https://github.com/dotnet/runtime/issues/40738")] [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134262", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public static void MethodTakesRefToRefStructAsArg_ThrowsNSE() { // Use a Binder to trick the reflection stack into treating the returned null diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV1Tests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV1Tests.cs index 2b8069635cf3af..f172824401465b 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV1Tests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV1Tests.cs @@ -3187,6 +3187,7 @@ private static async Task StateMachineAsync_SingleThread_ChainEventsAndCallstack } [ConditionalFact(typeof(AsyncProfilerTests), nameof(IsStateMachineAsyncSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134145", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public async Task StateMachineAsync_SingleThread_ChainEventsAndCallstack() { var events = await CollectEventsAsync(ResumeStateMachineAsyncCallstackKeyword | StateMachineAsyncCoreKeywords | StateMachineAsyncMethodKeywords, async () => @@ -3260,6 +3261,7 @@ private static async ValueTask StateMachineAsync_ValueTask_SingleThread_ChainEve } [ConditionalFact(typeof(AsyncProfilerTests), nameof(IsStateMachineAsyncSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134145", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public async Task StateMachineAsync_ValueTask_SingleThread_ChainEventsAndCallstack() { var events = await CollectEventsAsync(ResumeStateMachineAsyncCallstackKeyword | StateMachineAsyncCoreKeywords | StateMachineAsyncMethodKeywords, async () => @@ -3336,6 +3338,7 @@ private static async ValueTask StateMachineAsync_PoolingValueTask_SingleThread_C } [ConditionalFact(typeof(AsyncProfilerTests), nameof(IsStateMachineAsyncSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/134145", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public async Task StateMachineAsync_PoolingValueTask_SingleThread_ChainEventsAndCallstack() { var events = await CollectEventsAsync(ResumeStateMachineAsyncCallstackKeyword | StateMachineAsyncCoreKeywords | StateMachineAsyncMethodKeywords, async () => diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV2Tests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV2Tests.cs index 927a1341d05ce9..71cd47c1a7ef72 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV2Tests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncProfilerV2Tests.cs @@ -1807,6 +1807,7 @@ private static async Task RuntimeAsync_WhenAny_TracksAllBranches_Marker() } [ConditionalFact(typeof(AsyncProfilerTests), nameof(IsRuntimeAsyncSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/133627", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public async Task RuntimeAsync_WhenAny_TracksAllBranches() { var events = await CollectEventsAsync(RuntimeAsyncCallstackKeywords, RuntimeAsync_WhenAny_TracksAllBranches_Marker); diff --git a/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexPrefixAnalyzerTests.cs b/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexPrefixAnalyzerTests.cs index 5ef0a80fa1f9c6..ff20ec301b53d3 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexPrefixAnalyzerTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexPrefixAnalyzerTests.cs @@ -64,6 +64,7 @@ public void FindFirstCharClass(string pattern, int options, string? expectedSet) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/66118", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public void FindFirstCharClass_StressDeep() { int nesting = 8000; diff --git a/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexReductionTests.cs b/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexReductionTests.cs index d2dc68a65bd778..d5678257655ce1 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexReductionTests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexReductionTests.cs @@ -784,6 +784,7 @@ public void MinMaxLengthIsCorrect(string pattern, int options, int expectedMin, } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/66118", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmReadyToRun))] public void MinMaxLengthIsCorrect_HugeDepth() { const int Depth = 10_000; diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 9f48d7b47b225b..cc791c928b16f6 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -87,6 +87,14 @@ + + + + + + + +