Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
acba56d
Enable all the tests with trimming issues
radical Apr 22, 2021
62e7c7a
[wasm] Disable tests that fail to build with trimming
radical Apr 22, 2021
1e1a74c
[wasm] Disable System.Linq.Expressions.Tests due to trimming errors
radical Apr 22, 2021
f285564
[wasm] Fix build errors due to trimming in System.Reflection.Metadata…
radical Apr 15, 2021
7f65c2b
[wasm] fix build error for System.Reflection.Tests
radical Apr 13, 2021
539048c
Merge remote-tracking branch 'origin/main' into test-trimming-for-aot
radical Apr 24, 2021
5bffdba
[wasm] Fix trimming errors for System.Runtime tests
radical Apr 8, 2021
10506d8
[wasm] Disable test failing with trimming - System.Reflection.Metadat…
radical Apr 24, 2021
d8451af
[wasm] Disable System.Runtime.InteropServices.Tests due to trimming
radical Apr 24, 2021
49c7e5a
[wasm] Fix trimming errors for Microsoft.Extensions.Logging.Tests
radical Apr 24, 2021
7e653a0
Disable tests for https://github.com/dotnet/runtime/issues/51211
radical Apr 25, 2021
1374c91
[wasm] Disable more tests failing with trimming
radical Apr 25, 2021
390e4e9
[wasm] Disable individual tests failing with trimming
radical Apr 25, 2021
362608f
[wasm] Fix trimming errors for System.Runtime.Extensions.Tests
radical Apr 11, 2021
12cf86b
[wasm] Fix System.Reflection.Tests failing due to trimming
radical Apr 25, 2021
7d31a83
Merge remote-tracking branch 'origin/main' into test-trimming-for-aot
radical Apr 26, 2021
59bb6c6
[wasm] Fix trimming errors for System.Runtime.Serialization.Json.Tests
radical Apr 26, 2021
62df596
[wasm] Fix trimming errors in System.Xml.RW.* tests
radical Apr 26, 2021
12cdcbd
[wasm] Fix trimming errors for System.Runtime.Caching.Tests
radical Apr 8, 2021
dcce073
[wasm] Fix trimming errors for System.Tests.ActivatorTests
radical Apr 9, 2021
a92333e
[wasm] Fix trimming errors for Microsoft.Extensions.Logging.Test.Trac…
radical Apr 9, 2021
f3b0d74
[wasm][eat] Disable failing test System.Data.Tests.XmlDataReaderTest.…
radical Apr 26, 2021
e89323c
[wasm] Fix trimming errors for System.Reflection.Tests
radical Apr 26, 2021
e09cad4
[wasm] Fix trimming errors for System.Reflection.Tests
radical Apr 26, 2021
2b10631
[wasm] Fix trimming errors in System.Reflection.Tests
radical Apr 26, 2021
189a79d
[wasm[eat] Fix test failures due to missing type
radical Apr 26, 2021
437d614
[wasm][eat] Fix System.Text.Json.Tests.DebuggerTests caused by trimming
radical Apr 26, 2021
b0274a4
[wasm] Fix test failing due to trimming
radical Apr 26, 2021
f579f8b
[wasm][eat] Disable System.Text.Json tests failing due to trimming
radical Apr 26, 2021
999426f
Disable test failing due to trimming in System.Reflection.Tests
radical Apr 26, 2021
3a91a5d
Disable tests failing due to trimming in System.Runtime.Loader
radical Apr 26, 2021
6d44922
Use linker substitutions to set PlatformDetection.IsBuiltWithAggressi…
radical Apr 26, 2021
d3e215a
Use TestUtilities substitutions only if AggressiveTrimming is enabled
radical Apr 26, 2021
1ac21c3
Address review feedback - rename ILDescriptorsPath
radical Apr 26, 2021
b9bf835
Address review feedback, move CoreCLR linker file next to the project
radical Apr 26, 2021
0aee262
Address review feedback - move ModuleCore.xml closer to it's use
radical Apr 26, 2021
bf123ca
Address review feedback - Move root assembly references to descriptor…
radical Apr 26, 2021
6ecbceb
Fix ILLinkDescriptorsPath
radical Apr 27, 2021
3dc25ee
[wasm] Disable some System.Text.Json tests
radical Apr 27, 2021
812f860
[wasm] Disable failing test in System.Xml.Xsl.XslCompiledTransformApi…
radical Apr 22, 2021
2d666e6
Preserve xunit type in tests
radical Apr 27, 2021
620c5bb
[wasm] Disable failing tests in System.Xml.Xsl.XslCompiledTransformAp…
radical Apr 27, 2021
c57520d
[wasm] Disable failing tests in `System.Runtime.Tests`
radical Apr 27, 2021
91fca65
Merge remote-tracking branch 'origin/main' into test-trimming-for-aot
radical Apr 27, 2021
5507316
Merge remote-tracking branch 'origin/main' into test-trimming-for-aot
radical Apr 27, 2021
b694c10
Update list of disabled tests, and disable aot ones only when relevant
radical Apr 27, 2021
d792ac7
Fix build: don't run aot for tests that fail with eat
radical Apr 27, 2021
6b8cada
Disable failing test `DataContractSerializerTests.DCS_DerivedTypeWith…
radical Apr 27, 2021
8a912e6
Disable System.Reflection.Metadata.Decoding.Tests.CustomAttributeDeco…
radical Apr 27, 2021
0a770d0
Disable System.Reflection.Tests.CustomAttributeTests.CustomAttributeT…
radical Apr 27, 2021
c004584
Disable System.Runtime.Extensions.Tests for aot
radical Apr 27, 2021
ee78cd7
Disable System.Runtime.Tests, and System.Text.Json.Tests for aot
radical Apr 27, 2021
a644852
Fix path for System.Text.Json tests
radical Apr 28, 2021
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
1 change: 1 addition & 0 deletions eng/testing/ILLink.Descriptor.xunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<method signature="System.Void .ctor(System.Object,System.Object,System.Object)" />
</type>
<type fullname="Xunit.Sdk.FactDiscoverer" />
<type fullname="Xunit.Sdk.CollectionPerAssemblyTestCollectionFactory" />
</assembly>
<assembly fullname="Microsoft.DotNet.XUnitExtensions" />
<assembly fullname="xunit.core">
Expand Down
13 changes: 13 additions & 0 deletions eng/testing/ILLinkDescriptors/ILLink.Descriptors.Castle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<linker>
<assembly fullname="Castle.Core">
<namespace fullname="Castle.DynamicProxy" />
<type fullname="Castle.DynamicProxy.Internal.CompositionInvocation" />
<type fullname="Castle.DynamicProxy.Internal.AbstractInvocation" />
<type fullname="Castle.DynamicProxy.Internal.InheritanceInvocation" />
</assembly>
<assembly fullname="Moq">
<type fullname="Moq.Internals.InterfaceProxy">
<method signature="System.Void .ctor()" />
</type>
</assembly>
</linker>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<linker>
<assembly fullname="System.Private.Xml.Linq">
<type fullname="System.Xml.Linq.XElement" />
</assembly>
<assembly fullname="System.Private.DataContractSerialization">
<type fullname="System.Runtime.Serialization.KeyValuePairAdapter`2" />
</assembly>
</linker>
1 change: 1 addition & 0 deletions eng/testing/tests.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<TestDependsOn Condition="'$(TestNoBuild)' != 'true' and '$(BuildAllProjects)' != 'true'">Build</TestDependsOn>
<TestDependsOn>$(TestDependsOn);GenerateRunScript;RunTests</TestDependsOn>
<VSTestNoLogo>true</VSTestNoLogo>
<ILLinkDescriptorsPath>$(MSBuildThisFileDirectory)ILLinkDescriptors\</ILLinkDescriptorsPath>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

<ItemGroup>
<Compile Include="$(CommonTestPath)Extensions\ConfigurationRootTest.cs" Link="Common\Extensions\ConfigurationRootTest.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<Compile Include="Common/*.cs" />
<Compile Include="*.cs" />
<Compile Include="$(CommonTestPath)Extensions\ConfigurationRootTest.cs" Link="Common\Extensions\ConfigurationRootTest.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.FileProviders.Abstractions\src\Microsoft.Extensions.FileProviders.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.FileProviders.Composite\src\Microsoft.Extensions.FileProviders.Composite.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Primitives\src\Microsoft.Extensions.Primitives.csproj" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Http\src\Microsoft.Extensions.Http.csproj" SkipUseReferenceAssembly="true" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection\src\Microsoft.Extensions.DependencyInjection.csproj" />
<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
Link="tests\DI.Common\Common\src\TestLogger.cs" />
<Compile Include="..\DI.Common\Common\src\TestLoggerFactory.cs"
Link="tests\DI.Common\Common\src\TestLoggerFactory.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)..\ILLink.Descriptors.xml" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<linker>
<assembly fullname="System.Diagnostics.TraceSource">
<type fullname="System.Diagnostics.TraceListener">
<method signature="System.Void .ctor()" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why this is necessary? This smells like a product bug to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a92333e (#51697)

fail: [FAIL] Microsoft.Extensions.Logging.Test.TraceSourceLoggerTest.Log_Shoud_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(shouldFormatterBeNull: True)
info: Castle.DynamicProxy.InvalidProxyConstructorArgumentsException : Can not instantiate proxy of class: System.Diagnostics.TraceListener.
info: Could not find a parameterless constructor.
info:    at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyInstance(Type proxyType, List`1 proxyArguments, Type classToProxy, Object[] constructorArguments)
info:    at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
info:    at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments)
info:    at Moq.Mock`1[[System.Diagnostics.TraceListener, System.Diagnostics.TraceSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].InitializeInstance()
info:    at Moq.Mock`1[[System.Diagnostics.TraceListener, System.Diagnostics.TraceSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].OnGetObject()
info:    at Moq.Mock.get_Object()
info:    at Moq.Mock`1[[System.Diagnostics.TraceListener, System.Diagnostics.TraceSource, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].get_Object()
info:    at Microsoft.Extensions.Logging.Test.TraceSourceLoggerTest.<>c__DisplayClass2_0.<Log_Shoud_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not>b__0(ILoggingBuilder builder)
info:    at Microsoft.Extensions.DependencyInjection.LoggingServiceCollectionExtensions.AddLogging(IServiceCollection services, Action`1 configure)
info:    at Microsoft.Extensions.Logging.Test.TestLoggerBuilder.Create(Action`1 configure)
info:    at Microsoft.Extensions.Logging.Test.TraceSourceLoggerTest.Log_Shoud_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(Boolean shouldFormatterBeNull)
info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, we are using Mock<TraceListener> in the test. Maybe the test could be annotated with DynamicDependency instead, so it is more discoverable about why this needs to be preserved.

</type>
</assembly>
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
<ProjectReference Include="..\src\Microsoft.Extensions.Primitives.csproj" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
<Compile Include="Design\DesignerTransactionTests.cs" />
<Compile Include="Security\Authentication\ExtendedProtection\ExtendedProtectionPolicyTypeConverterTests.cs" />
<Compile Include="XTypeDescriptionProviderTests.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Castle.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.ComponentModel.TypeConverter.TestData" Version="$(SystemComponentModelTypeConverterTestDataVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

using System;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
Expand All @@ -34,6 +35,7 @@ namespace System.Data.Tests
public class XmlDataReaderTest
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51369", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
public void XmlLoadTest()
{
var ds = new DataSet();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<linker>
<assembly fullname="ModuleCore">
<type fullname="OLEDB.Test.ModuleCore.XmlInlineDataDiscoverer">
<method signature="System.Void .ctor()" />
</type>
</assembly>
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..'))" />

<ItemGroup>
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)..\ILLink.Descriptors.ModuleCore.xml" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />
<ProjectReference Include="..\..\XmlReaderLib\System.Xml.RW.XmlReaderLib.csproj" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)System\Xml\ModuleCore\ModuleCore.csproj" />
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />

<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)..\..\ILLink.Descriptors.ModuleCore.xml" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)System\Xml\ModuleCore\ModuleCore.csproj" />
<ProjectReference Include="$(CommonTestPath)System\Xml\XmlCoreTest\XmlCoreTest.csproj" />

<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)..\ILLink.Descriptors.ModuleCore.xml" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
<Compile Include="$(TestSourceFolder)..\..\..\..\System.Runtime.Serialization.Xml\tests\SerializationTypes.RuntimeOnly.cs" />
<Compile Include="$(TestSourceFolder)..\XmlSerializerTests.cs" />
<Compile Include="$(TestSourceFolder)..\XmlSerializerTests.RuntimeOnly.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Serialization.xml" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
<Compile Include="$(TestSourceFolder)XmlSerializerTests.cs" />
<Compile Include="$(TestSourceFolder)XmlSerializerTests.Internal.cs" />
<Compile Include="$(TestSourceFolder)XmlSerializerTests.RuntimeOnly.cs" />

<TrimmerRootDescriptor Include="$(ILLinkDescriptorsPath)ILLink.Descriptors.Serialization.xml" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using Xunit;
using Xunit.Abstractions;
using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -543,6 +544,7 @@ public void XmlResolver2(XslInputType xslInputType, ReaderType readerType)
}

//[Variation(id = 3, Desc = "Default XmlResolver, load style sheet with document function, should resolve during transform", Pri = 1, Param = "DefaultResolver.txt")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)]
[InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)]
[InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)]
Expand Down Expand Up @@ -2407,6 +2409,7 @@ public void XmlResolver1(XslInputType xslInputType , ReaderType readerType, Outp
}

//[Variation("Pass null XmlResolver, load style sheet with document function, should not resolve during transform", Param = "xmlResolver_document_function.txt")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)]
[InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)]
[InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)]
Expand Down Expand Up @@ -2442,6 +2445,7 @@ public void XmlResolver2(object param, XslInputType xslInputType, ReaderType rea
}

//[Variation("Default XmlResolver, load style sheet with document function, should resolve during transform", Param = "DefaultResolver.txt")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)]
[InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Writer, NavType.XPathDocument)]
[InlineData("DefaultResolver.txt", XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.TextWriter, NavType.XPathDocument)]
Expand Down Expand Up @@ -2969,6 +2973,7 @@ public void TransformStrStrResolver1(XslInputType xslInputType, ReaderType reade
}

//[Variation("Pass null XmlResolver, load style sheet with document function, should not resolve during transform")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData(XslInputType.Reader, ReaderType.XmlValidatingReader)]
[InlineData(XslInputType.URI, ReaderType.XmlValidatingReader)]
[InlineData(XslInputType.Navigator, ReaderType.XmlValidatingReader)]
Expand Down Expand Up @@ -2997,6 +3002,7 @@ public void TransformStrStrResolver2(XslInputType xslInputType, ReaderType reade
}

//[Variation("Pass XmlUrlResolver, load style sheet with document function, should resolve during transform", Param = "xmlResolver_document_function.txt")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData("xmlResolver_document_function.txt", XslInputType.Reader, ReaderType.XmlValidatingReader)]
[InlineData("xmlResolver_document_function.txt", XslInputType.URI, ReaderType.XmlValidatingReader)]
[InlineData("xmlResolver_document_function.txt", XslInputType.Navigator, ReaderType.XmlValidatingReader)]
Expand Down Expand Up @@ -3331,6 +3337,7 @@ public CTransformRegressionTest(ITestOutputHelper output) : base(output)
}

//[Variation("Bug398968 - Globalization is broken for document() function")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51244", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData(XslInputType.URI, ReaderType.XmlValidatingReader, OutputType.Stream, NavType.XPathDocument)]
[Theory]
public void RegressionTest1(XslInputType xslInputType, ReaderType readerType, OutputType outputType, NavType navType)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void XsltSettings1_2_ContainsScript(object param0, object param1, object
}

//[Variation(id = 5, Desc = "Test the document function with EnableDocumentFunction, should work", Pri = 0, Params = new object[] { "XsltSettings.xml", "XsltSettings2.xsl", true, false })]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData(5, "XsltSettings.xml", "XsltSettings2.xsl", true, false)]
//[Variation(id = 8, Desc = "Test the document function with TrustedXslt, should work", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings2.xsl", true, true })]
[InlineData(8, "XsltSettings.xml", "XsltSettings2.xsl", true, true)]
Expand All @@ -90,6 +91,7 @@ public void XsltSettings1_1_ExternalURI(object param0, object param1, object par
}

//[Variation(id = 18, Desc = "Test 6 with EnableDocumentFunction override, should work", Pri = 1, Params = new object[] { "XsltSettings.xml", "XsltSettings2.xsl", false, false, true, false })]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51911", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
[InlineData(18, "XsltSettings.xml", "XsltSettings2.xsl", false, false, true, false)]
[Theory]
public void XsltSettings1_2_ExternalURI(object param0, object param1, object param2, object param3, object param4, object param5, object param6)
Expand Down
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;
using System.Collections.Immutable;
using System.IO;
using System.Reflection.Metadata.Tests;
Expand All @@ -12,6 +13,7 @@ namespace System.Reflection.Metadata.Decoding.Tests
public class CustomAttributeDecoderTests
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51958", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Type assembly name is different on .NET Framework.")]
public void TestCustomAttributeDecoder()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<linker>
<assembly fullname="mscorlib" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still necessary with the latest linker? It should be preserving facades like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was needed with whatever linker is being used with main from a couple of days ago.

</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,7 @@
<WasmFilesToIncludeFromPublishDir Include="System.Private.CoreLib.dll" />
<WasmFilesToIncludeFromPublishDir Include="System.Reflection.MetadataLoadContext.Tests.dll" />
<WasmFilesToIncludeFromPublishDir Include="mscorlib.dll" />

<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
</ItemGroup>
</Project>
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;
using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand All @@ -13,6 +14,7 @@ namespace System.Reflection.Tests
public static partial class CustomAttributeTests
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/51958", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))]
public static void CustomAttributeTest1()
{
Type t = typeof(AttributeHolder1); // Intentionally not projected. We're reflecting on this (and Invoking it) to get the validation baseline data.
Expand Down
1 change: 1 addition & 0 deletions src/libraries/System.Reflection/tests/AssemblyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public void GetType_DoesntSearchMscorlib()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50715", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
public void GetType_DefaultsToItself()
{
Assembly a = typeof(AssemblyTests).Assembly;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<linker>
<assembly fullname="System.Reflection.TestExe" />
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestExe\System.Reflection.TestExe.csproj" />

<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.CoreCLR.xml" />
</ItemGroup>
</Project>
</Project>
7 changes: 7 additions & 0 deletions src/libraries/System.Reflection/tests/ILLink.Descriptors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<linker>
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Collections.ArrayList" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Member Author

@radical radical Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e09cad4 (#51697)

    `IList` implementation on `ArrayList` was getting trimmed

   
      fail: [FAIL] System.Reflection.Tests.TypeInfoTests.IsAssignable(type: typeof(System.Collections.IList), c: typeof(System.Collections.ArrayList), expected: True)
      info: Assert.Equal() Failure
      info: Expected: True
      info: Actual:   False
      info:    at System.Reflection.Tests.TypeInfoTests.IsAssignable(Type type, Type c, Boolean expected) in /Users/radical/dev/r3/src/libraries/System.Reflection/tests/TypeInfoTests.cs:line 580
      info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /Users/radical/dev/r3/src/mono/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 378

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is just that one test, maybe adding a DynamicDependency on the test would be a better approach. Then it localizes it, and you can tell why it is needed. Having it rooted here makes it hard to reason about.

</assembly>
<assembly fullname="ForwardedTypesAssembly" />
<assembly fullname="TestAssembly" />
</linker>
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<WasmFilesToIncludeFromPublishDir Include="$(AssemblyName).pdb" />
</ItemGroup>
<ItemGroup>
<TrimmerRootAssembly Include="TestAssembly" />
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />

<!-- Assemblies that should be excluded from the bundle -->
<__ExcludeFromBundle Include="TestAssembly.dll" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<linker>
<assembly fullname="System.Configuration.ConfigurationManager">
<type fullname="System.Configuration.ClientConfigurationHost">
<method signature="System.Void .ctor()" />
</type>
</assembly>
</linker>
Loading