Skip to content

Commit 82f7144

Browse files
authored
[wasm] Enable tests blocked by IL2105 (#57457)
* Disable ReflectionCachesUpdateHandler_CachesCleared with aggressive trimming * Enable more tests stopped by 2105 * Create tests.mobile.targets Suppress IL2025 * Remove comment enabling trim warnings * Mark more active issues
1 parent 24971b0 commit 82f7144

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

eng/testing/tests.mobile.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
<PublishTrimmed>true</PublishTrimmed>
1414
<!-- Suppress linker warnings as these are tests -->
1515
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
16-
<!-- Can be removed when SDK update picks up https://github.com/dotnet/sdk/pull/18655. -->
17-
<NoWarn>$(NoWarn);IL2111</NoWarn>
16+
<NoWarn>$(NoWarn);IL2111;IL2105;IL2025</NoWarn>
1817
<!-- https://github.com/dotnet/sdk/issues/18581 tracks needing to set 2 properties to disable warnings. -->
1918
<EnableTrimAnalyzer>false</EnableTrimAnalyzer>
2019

src/libraries/System.ComponentModel.TypeConverter/tests/ReflectionCachesUpdateHandlerTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace System.ComponentModel.Tests
1111
public class ReflectionCachesUpdateHandlerTests
1212
{
1313
[Fact]
14+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57456", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
1415
public void ReflectionCachesUpdateHandler_CachesCleared()
1516
{
1617
AttributeCollection ac1 = TypeDescriptor.GetAttributes(typeof(ReflectionCachesUpdateHandlerTests));

src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_ConstructorAndPropertyTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public static void IsReadOnlyTest()
118118
}
119119

120120
[Fact]
121+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
121122
public static void DebuggerAttributeTests()
122123
{
123124
ObservableCollection<int> col = new ObservableCollection<int>(new[] {1, 2, 3, 4});
@@ -129,6 +130,7 @@ public static void DebuggerAttributeTests()
129130
}
130131

131132
[Fact]
133+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
132134
public static void DebuggerAttribute_NullCollection_ThrowsArgumentNullException()
133135
{
134136
TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => DebuggerAttributes.ValidateDebuggerTypeProxyProperties(typeof(ObservableCollection<int>), null));

src/libraries/System.ObjectModel/tests/ObservableCollection/ObservableCollection_Serialization.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public void SerializeDeserialize_Roundtrips(ObservableCollection<int> c)
2727
}
2828

2929
[Fact]
30+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
3031
public void OnDeserialized_MonitorNotInitialized_ExpectSuccess()
3132
{
3233
var observableCollection = new ObservableCollection<int>();

src/libraries/System.ObjectModel/tests/ReadOnlyDictionary/ReadOnlyDictionaryTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public static void CannotModifyDictionaryTests_Negative()
224224
}
225225

226226
[Fact]
227+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
227228
public static void DebuggerAttributeTests()
228229
{
229230
ReadOnlyDictionary<int, int> dict = new ReadOnlyDictionary<int, int>(new Dictionary<int, int>{{1, 2}, {2, 4}, {3, 6}});
@@ -247,6 +248,7 @@ public static void DebuggerAttributeTests()
247248
}
248249

249250
[Fact]
251+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
250252
public static void DebuggerAttribute_NullDictionary_ThrowsArgumentNullException()
251253
{
252254
TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => DebuggerAttributes.ValidateDebuggerTypeProxyProperties(typeof(ReadOnlyDictionary<int, int>), null));
@@ -255,6 +257,7 @@ public static void DebuggerAttribute_NullDictionary_ThrowsArgumentNullException(
255257
}
256258

257259
[Fact]
260+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
258261
public static void DebuggerAttribute_NullDictionaryKeys_ThrowsArgumentNullException()
259262
{
260263
TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => DebuggerAttributes.ValidateDebuggerTypeProxyProperties(typeof(ReadOnlyDictionary<int, int>.KeyCollection), new Type[] { typeof(int) }, null));

src/libraries/System.ObjectModel/tests/ReadOnlyObservableCollection/ReadOnlyObservableCollectionTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ public static void CannotModifyDictionaryTests_Negative()
197197
}
198198

199199
[Fact]
200+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
200201
public static void DebuggerAttribute_Tests()
201202
{
202203
ReadOnlyObservableCollection<int> col = new ReadOnlyObservableCollection<int>(new ObservableCollection<int>(new[] {1, 2, 3, 4}));
@@ -208,6 +209,7 @@ public static void DebuggerAttribute_Tests()
208209
}
209210

210211
[Fact]
212+
[ActiveIssue("https://github.com/dotnet/runtime/issues/57588", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))]
211213
public static void DebuggerAttribute_NullCollection_ThrowsArgumentNullException()
212214
{
213215
TargetInvocationException ex = Assert.Throws<TargetInvocationException>(() => DebuggerAttributes.ValidateDebuggerTypeProxyProperties(typeof(ReadOnlyObservableCollection<int>), null));

src/libraries/tests.proj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,6 @@
242242
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.DiagnosticSource\tests\System.Diagnostics.DiagnosticSource.Tests.csproj" />
243243
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj" />
244244

245-
<!-- Issue: https://github.com/dotnet/runtime/issues/51602 -->
246-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.ComponentModel.Primitives\tests\System.ComponentModel.Primitives.Tests.csproj" />
247-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.ObjectModel\tests\System.ObjectModel.Tests.csproj" />
248-
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.ComponentModel.TypeConverter/tests/System.ComponentModel.TypeConverter.Tests.csproj" />
249-
250245
<!-- Issue: https://github.com/dotnet/runtime/issues/51708 -->
251246
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Linq.Expressions\tests\System.Linq.Expressions.Tests.csproj" />
252247

0 commit comments

Comments
 (0)