Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
09239c9
Disable some of System.Diagnostics.Tracing.Tests tests due to failures
MaximLipnin Jul 21, 2021
38224c8
Disable ImageTests.FromFile_NullFileName_ThrowsArgumentNullException …
MaximLipnin Jul 21, 2021
146049d
Disable System.Runtime.Tests.JitInfoTests.JitInfoIsPopulated test
MaximLipnin Jul 21, 2021
99b22ae
Disable System.Drawing.Tests.ImageTests.FromFile_LongSegment_ThrowsEx…
MaximLipnin Jul 21, 2021
71f614c
Exclude System.Runtime.Experimental.Tests test suite due to an app crash
MaximLipnin Jul 21, 2021
48ed88e
Disable System.Drawing.Tests.BrushTests.SetNativeBrush_Brush_Success
MaximLipnin Jul 21, 2021
3c7d0c4
Disable some of System.Tests.OperatingSystemTests test on MacCatalyst
MaximLipnin Jul 21, 2021
3d78e69
Disable System.Text.Json.SourceGeneration.Tests on MacCatalyst due to…
MaximLipnin Jul 21, 2021
0ffee55
Merge branch 'main' into disable_tests_on_ios_tvos_maccatalyst
MaximLipnin Jul 21, 2021
49eb711
Disable System.Drawing.Drawing2D.Tests.HatchBrushTests.Ctor_InvalidHa…
MaximLipnin Jul 21, 2021
f697280
Disable System.Drawing.Tests.ImageTests.FromFile_NoSuchFile_ThrowsFil…
MaximLipnin Jul 21, 2021
efa5866
Merge branch 'main' into disable_tests_on_ios_tvos_maccatalyst
MaximLipnin Jul 21, 2021
5aa66f1
Use IsDrawingSupported helper for System.Drawing.Common tests
MaximLipnin Jul 21, 2021
9385989
Merge branch 'main' into disable_tests_on_ios_tvos_maccatalyst
MaximLipnin Jul 22, 2021
8864f7d
Annotate the entire System.Drawing.Tests.ImageTests class with Platfo…
MaximLipnin Jul 22, 2021
e5d8808
Remove individual method annotations in favor of class annotation
MaximLipnin Jul 22, 2021
a5660f2
Move back conditional theory attribute for System.Drawing.Tests.Image…
MaximLipnin Jul 22, 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace BasicEventSourceTests
public class ActivityTracking
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public void StartStopCreatesActivity()
{
using ActivityEventListener l = new ActivityEventListener();
Expand All @@ -27,6 +28,7 @@ public void StartStopCreatesActivity()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public async Task ActivityFlowsAsync()
{
using ActivityEventListener l = new ActivityEventListener();
Expand Down Expand Up @@ -75,6 +77,7 @@ private async Task YieldTwoActivitiesDeep(ActivityEventSource es)
// the future we might decide it wasn't even desirable to begin with.
// Compare with SetCurrentActivityIdAfterEventDoesNotFlowAsync below.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public async Task SetCurrentActivityIdBeforeEventFlowsAsync()
{
using ActivityEventListener l = new ActivityEventListener();
Expand All @@ -100,6 +103,7 @@ public async Task SetCurrentActivityIdBeforeEventFlowsAsync()
// the future we might decide it wasn't even desirable to begin with.
// Compare with SetCurrentActivityIdBeforeEventFlowsAsync above.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56073", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public async Task SetCurrentActivityIdAfterEventDoesNotFlowAsync()
{
using ActivityEventListener l = new ActivityEventListener();
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Drawing.Common/tests/BrushTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace System.Drawing.Tests
{
public class BrushTests
{
[Fact]
[ConditionalFact(Helpers.IsDrawingSupported)]
public void SetNativeBrush_Brush_Success()
{
using (var brush = new SubBrush())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void Ctor_HatchStyle_ForeColor_BackColor(HatchStyle hatchStyle, Color for
}
}

[Theory]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[InlineData(HatchStyle.Horizontal -1 )]
[InlineData(HatchStyle.SolidDiamond + 1)]
public void Ctor_InvalidHatchStyle_ThrowsArgumentException(HatchStyle hatchStyle)
Expand Down
42 changes: 22 additions & 20 deletions src/libraries/System.Drawing.Common/tests/ImageTests.cs
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.Generic;
using System.Drawing.Imaging;
using System.IO;
Expand All @@ -13,6 +14,7 @@

namespace System.Drawing.Tests
{
[ConditionalClass(typeof(PlatformDetection),nameof(PlatformDetection.IsDrawingSupported))]
public class ImageTests
{
private const int PropertyTagLuminanceTable = 0x5090;
Expand All @@ -22,15 +24,15 @@ public class ImageTests
private const int PropertyTagTypeShort = 3;

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
public void PropertyIdList_GetBitmapJpg_Success()
{
using var bitmap = new Bitmap(Helpers.GetTestBitmapPath("nature24bits.jpg"));
Assert.Equal(new int[] { PropertyTagExifUserComment, PropertyTagChrominanceTable, PropertyTagLuminanceTable }, bitmap.PropertyIdList);
Assert.NotSame(bitmap.PropertyIdList, bitmap.PropertyIdList);
}

[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Returns new int[0] in .NET Framework.")]
public void PropertyIdList_GetEmptyMemoryBitmap_ReturnsExpected()
{
Expand All @@ -40,7 +42,7 @@ public void PropertyIdList_GetEmptyMemoryBitmap_ReturnsExpected()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
public void PropertyItems_GetBitmapJpg_Success()
{
using var bitmap = new Bitmap(Helpers.GetTestBitmapPath("nature24bits.jpg"));
Expand Down Expand Up @@ -82,7 +84,7 @@ public void PropertyItems_GetBitmapJpg_Success()
Assert.NotSame(items, bitmap.PropertyItems);
}

[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Returns new PropertyItem[0] in .NET Framework.")]
public void PropertyItems_GetEmptyBitmapBmp_Success()
{
Expand All @@ -91,7 +93,7 @@ public void PropertyItems_GetEmptyBitmapBmp_Success()
Assert.Same(bitmap.PropertyItems, bitmap.PropertyItems);
}

[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "Returns new PropertyItem[0] in .NET Framework.")]
public void PropertyItems_GetEmptyMemoryBitmap_ReturnsExpected()
{
Expand All @@ -101,7 +103,7 @@ public void PropertyItems_GetEmptyMemoryBitmap_ReturnsExpected()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
public void GetPropertyItem_InvokeExistsBitmapBmp_Success()
{
using var bitmap = new Bitmap(Helpers.GetTestBitmapPath("nature24bits.jpg"));
Expand All @@ -112,7 +114,7 @@ public void GetPropertyItem_InvokeExistsBitmapBmp_Success()
Assert.Equal("LEAD Technologies Inc. V1.01\0", Encoding.ASCII.GetString(item.Value));
}

[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand All @@ -122,7 +124,7 @@ public void GetPropertyItem_NoSuchPropertyItemEmptyMemoryBitmap_ThrowsArgumentEx
Assert.Throws<ArgumentException>(null, () => bitmap.GetPropertyItem(propid));
}

[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand All @@ -133,7 +135,7 @@ public void GetPropertyItem_NoSuchPropertyItemEmptyImageBitmapBmp_ThrowsArgument
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
public void RemovePropertyItem_InvokeMemoryBitmap_Success()
{
using var source = new Bitmap(Helpers.GetTestBitmapPath("nature24bits.jpg"));
Expand Down Expand Up @@ -162,7 +164,7 @@ public void RemovePropertyItem_InvokeMemoryBitmap_Success()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
public void RemovePropertyItem_InvokeBitmapJpg_Success()
{
using var bitmap = new Bitmap(Helpers.GetTestBitmapPath("nature24bits.jpg"));
Expand All @@ -183,7 +185,7 @@ public void RemovePropertyItem_InvokeBitmapJpg_Success()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand All @@ -194,7 +196,7 @@ public void RemovePropertyItem_NoSuchPropertyItemEmptyMemoryBitmap_ThrowsExterna
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand All @@ -205,7 +207,7 @@ public void RemovePropertyItem_NoSuchPropertyItemEmptyImageBitmapBmp_ThrowsExter
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand All @@ -224,7 +226,7 @@ public void RemovePropertyItem_NoSuchPropertyNotEmptyMemoryBitmap_ThrowsArgument
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand All @@ -235,7 +237,7 @@ public void RemovePropertyItem_NoSuchPropertyNotEmptyBitmapJpg_ThrowsArgumentExc
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand Down Expand Up @@ -295,7 +297,7 @@ public void SetPropertyItem_InvokeMemoryBitmap_Success(int propid)
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand Down Expand Up @@ -438,7 +440,7 @@ public void SetPropertyItem_InvokeBitmapJpg_Success(int propid)
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[InlineData(0)]
[InlineData(1)]
[InlineData(-1)]
Expand Down Expand Up @@ -508,7 +510,7 @@ public static IEnumerable<object[]> InvalidBytes_TestData()
}

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[MemberData(nameof(InvalidBytes_TestData))]
public void FromFile_InvalidBytes_ThrowsOutOfMemoryException(byte[] bytes)
{
Expand Down Expand Up @@ -564,7 +566,7 @@ public void FromFile_NoSuchFile_ThrowsFileNotFoundException()

[ActiveIssue("https://github.com/dotnet/runtime/issues/22221", TestPlatforms.AnyUnix)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34591", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
[ConditionalTheory(Helpers.IsDrawingSupported)]
[Theory]
[MemberData(nameof(InvalidBytes_TestData))]
public void FromStream_InvalidBytes_ThrowsArgumentException(byte[] bytes)
{
Expand Down Expand Up @@ -686,7 +688,7 @@ public void GetEncoderParameterList_ReturnsExpected(ImageFormat format, Guid[] e
}

[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, ".NET Framework throws ExternalException")]
[ConditionalFact(Helpers.IsDrawingSupported)]
[Fact]
public void Save_InvalidDirectory_ThrowsDirectoryNotFoundException()
{
using (var bitmap = new Bitmap(1, 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ public static void IsOSPlatformVersionAtLeast_InvalidArgs_Throws()
public static void TestIsOSVersionAtLeast_Android_21() => Assert.True(OperatingSystem.IsAndroidVersionAtLeast(21)); // 21 is our min supported version

[Fact, PlatformSpecific(TestPlatforms.iOS)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56084", TestPlatforms.MacCatalyst)]
public static void TestIsOSPlatform_IOS() => TestIsOSPlatform("iOS", OperatingSystem.IsIOS);

[Fact, PlatformSpecific(TestPlatforms.iOS)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56084", TestPlatforms.MacCatalyst)]
public static void TestIsOSVersionAtLeast_IOS() => TestIsOSVersionAtLeast("iOS");

[Fact, PlatformSpecific(TestPlatforms.OSX)]
Expand All @@ -127,9 +129,11 @@ public static void OSX_Is_Treated_as_macOS()
}

[Fact, PlatformSpecific(TestPlatforms.MacCatalyst)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56084", TestPlatforms.MacCatalyst)]
public static void TestIsOSPlatform_MacCatalyst() => TestIsOSPlatform("MacCatalyst", OperatingSystem.IsMacCatalyst);

[Fact, PlatformSpecific(TestPlatforms.MacCatalyst)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56084", TestPlatforms.MacCatalyst)]
public static void TestIsOSVersionAtLeast_MacCatalyst() => TestIsOSVersionAtLeast("MacCatalyst");

[Fact, PlatformSpecific(TestPlatforms.MacCatalyst)]
Expand All @@ -143,6 +147,7 @@ public static void MacCatalyst_Is_Also_iOS()
}

[Fact, PlatformSpecific(TestPlatforms.iOS)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/56084", TestPlatforms.MacCatalyst)]
public static void IOS_Is_Not_Also_MacCatalyst()
{
Assert.False(OperatingSystem.IsOSPlatform("MacCatalyst"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ private long MakeAndInvokeDynamicSquareMethod(int input)
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))] // JitInfo metrics will be 0 in AOT scenarios
[ActiveIssue("https://github.com/dotnet/runtime/issues/55712", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public void JitInfoIsPopulated()
{
TimeSpan beforeCompilationTime = System.Runtime.JitInfo.GetCompilationTime();
Expand Down
6 changes: 6 additions & 0 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<!-- https://github.com/dotnet/runtime/issues/52120 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj" />

<!-- Crash https://github.com/dotnet/runtime/issues/55823 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Experimental\tests\System.Runtime.Experimental.Tests.csproj" />

<!-- Crashes on CI but passes locally https://github.com/dotnet/runtime/issues/52615 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Microsoft.Extensions.Http.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging/tests/Common/Microsoft.Extensions.Logging.Tests.csproj" />
Expand Down Expand Up @@ -225,6 +228,9 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Tasks\tests\System.Threading.Tasks.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Tasks.Dataflow\tests\System.Threading.Tasks.Dataflow.Tests.csproj" />

<!-- Crash https://github.com/dotnet/runtime/issues/56085 -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Tests.csproj" />

<!-- Crashes on CI but passes locally https://github.com/dotnet/runtime/issues/52615 -->
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\Interpreter\iOS.Simulator.Interpreter.Test.csproj" />
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\InvariantCultureOnlyMode\iOS.Simulator.InvariantCultureOnlyMode.Test.csproj" />
Expand Down