Skip to content

Commit

Permalink
Disable System.Drawing.Common tests for mobile workloads and skip a f…
Browse files Browse the repository at this point in the history
…ew other tests (#57114)

Since the library is PNSE by default, make sure the tests do not run on mobile.
Also skips a few other tests.

Closes #57184
  • Loading branch information
steveisok authored Aug 13, 2021
1 parent f8c3777 commit defa26b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ public static bool IsDrawingSupported
#if NETCOREAPP
if (!IsWindows)
{
if (IsOSX)
if (IsMobile)
{
return false;
}
else if (IsOSX)
{
return NativeLibrary.TryLoad("libgdiplus.dylib", out _);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
/// </summary>
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
// SIGTERM is only handled on net6.0+, so the workaround to "clobber" the exit code is still in place on NetFramework
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
[SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
public void EnsureEnvironmentExitCode()
{
using var remoteHandle = RemoteExecutor.Invoke(async () =>
Expand Down Expand Up @@ -126,6 +127,7 @@ await Task.Run(() =>
/// Tests that calling Environment.Exit from the "main" thread doesn't hang the process forever.
/// </summary>
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
public void EnsureEnvironmentExitDoesntHang()
{
using var remoteHandle = RemoteExecutor.Invoke(async () =>
Expand Down
13 changes: 7 additions & 6 deletions src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,28 @@ public void TestExited_SynchronizingObject(bool invokeRequired)
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void ProcessStart_TryExitCommandAsFileName_ThrowsWin32Exception()
{
Assert.Throws<Win32Exception>(() => Process.Start(new ProcessStartInfo { UseShellExecute = false, FileName = "exit", Arguments = "42" }));
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void ProcessStart_UseShellExecuteFalse_FilenameIsUrl_ThrowsWin32Exception()
{
Assert.Throws<Win32Exception>(() => Process.Start(new ProcessStartInfo { UseShellExecute = false, FileName = "https://www.github.com/corefx" }));
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void ProcessStart_TryOpenFolder_UseShellExecuteIsFalse_ThrowsWin32Exception()
{
Assert.Throws<Win32Exception>(() => Process.Start(new ProcessStartInfo { UseShellExecute = false, FileName = Path.GetTempPath() }));
}

[Fact]
[SkipOnPlatform(TestPlatforms.OSX, "OSX doesn't support throwing on Process.Start")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/52882", TestPlatforms.MacCatalyst)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void TestStartWithBadWorkingDirectory()
{
string program;
Expand Down Expand Up @@ -231,6 +230,7 @@ public void TestStartWithBadWorkingDirectory()

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasWindowsShell))]
[OuterLoop("Launches File Explorer")]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void ProcessStart_UseShellExecute_OnWindows_OpenMissingFile_Throws()
{
string fileToOpen = Path.Combine(Environment.CurrentDirectory, "_no_such_file.TXT");
Expand All @@ -243,6 +243,7 @@ public void ProcessStart_UseShellExecute_OnWindows_OpenMissingFile_Throws()
[InlineData(true)]
[InlineData(false)]
[OuterLoop("Launches File Explorer")]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void ProcessStart_UseShellExecute_OnWindows_DoesNotThrow(bool isFolder)
{
string fileToOpen;
Expand Down Expand Up @@ -500,7 +501,7 @@ public void HasExited_GetNotStarted_ThrowsInvalidOperationException()
}

[Fact]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")]
public void Kill_NotStarted_ThrowsInvalidOperationException()
{
var process = new Process();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;net48</TargetFrameworks>
<IgnoreForCI Condition="'$(TargetOS)' == 'Browser'">true</IgnoreForCI>
<IgnoreForCI Condition="'$(TargetsMobile)' == 'true'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
Expand Down
8 changes: 6 additions & 2 deletions src/libraries/System.Runtime/tests/System/CharTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,12 @@ public static IEnumerable<object[]> UpperLowerCasing_TestData()

if (PlatformDetection.IsNotInvariantGlobalization)
{
yield return new object[] { '\u0131', 'I', "tr-TR" };
yield return new object[] { 'i', '\u0130', "tr-TR" };
// Android has issues w/ tr-TR, see https://github.com/dotnet/runtime/issues/37069
if (!PlatformDetection.IsAndroid)
{
yield return new object[] { '\u0131', 'I', "tr-TR" };
yield return new object[] { 'i', '\u0130', "tr-TR" };
}
yield return new object[] { '\u0660', '\u0660', "en-US" };
}
}
Expand Down

0 comments on commit defa26b

Please sign in to comment.