From 70eec54cd0ac00ab1bb1fa985ff796c6f09727b1 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 16 Feb 2017 16:15:35 +0200 Subject: [PATCH] Switched back to NUnit because xUnit had issues with the WGL tests --- build.cake | 12 +- cake/UtilsManaged.cake | 6 +- .../SkiaSharp.Desktop.Tests.csproj | 27 +--- tests/SkiaSharp.Desktop.Tests/packages.config | 9 +- tests/SkiaSharp.NetCore.Tests/project.json | 6 +- tests/Tests/GRContextTest.cs | 7 +- tests/Tests/GRGlInterfaceTest.cs | 5 +- tests/Tests/SKBasicTypesTest.cs | 150 +++++++++--------- tests/Tests/SKBitmapTest.cs | 68 ++++---- tests/Tests/SKCodecTest.cs | 76 ++++----- tests/Tests/SKColorTableTest.cs | 22 +-- tests/Tests/SKColorTest.cs | 82 +++++----- tests/Tests/SKDataTest.cs | 15 +- tests/Tests/SKManagedStreamTest.cs | 34 ++-- tests/Tests/SKPaintTest.cs | 22 +-- tests/Tests/SKPathTest.cs | 96 +++++------ tests/Tests/SKStringTest.cs | 8 +- tests/Tests/SKSurfaceTest.cs | 20 +-- tests/Tests/SKSvgTest.cs | 42 ++--- tests/Tests/SKTest.cs | 9 +- tests/Tests/SKTypefaceTest.cs | 48 +++--- tools/packages.config | 2 +- 22 files changed, 371 insertions(+), 395 deletions(-) diff --git a/build.cake b/build.cake index 4b199e9a..f9b319ca 100644 --- a/build.cake +++ b/build.cake @@ -14,8 +14,7 @@ var NuGetSources = new [] { MakeAbsolute (Directory ("./output")).FullPath, "htt var NugetToolPath = GetToolPath ("nuget.exe"); var XamarinComponentToolPath = GetToolPath ("xamarin-component.exe"); var CakeToolPath = GetToolPath ("Cake/Cake.exe"); -var TestConsoleToolPath_x86 = GetToolPath ("xunit.runner.console/tools/xunit.console.x86.exe"); -var TestConsoleToolPath_x64 = GetToolPath ("xunit.runner.console/tools/xunit.console.exe"); +var NUnitConsoleToolPath = GetToolPath ("NUnit.Console/tools/nunit3-console.exe"); var GenApiToolPath = GetToolPath ("Microsoft.DotNet.BuildTools.GenAPI/tools/GenAPI.exe"); var MDocPath = GetToolPath ("mdoc/mdoc.exe"); @@ -217,19 +216,19 @@ Task ("tests") c.Configuration = "Release"; c.Properties ["Platform"] = new [] { "x86" }; }); - RunTests("./tests/SkiaSharp.Desktop.Tests/bin/x86/Release/SkiaSharp.Desktop.Tests.dll", false); + RunTests("./tests/SkiaSharp.Desktop.Tests/bin/x86/Release/SkiaSharp.Desktop.Tests.dll"); DotNetBuild ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", c => { c.Configuration = "Release"; c.Properties ["Platform"] = new [] { "x64" }; }); - RunTests("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/SkiaSharp.Desktop.Tests.dll", true); + RunTests("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/SkiaSharp.Desktop.Tests.dll"); } // Mac OSX (Any CPU) if (IsRunningOnMac ()) { DotNetBuild ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", c => { c.Configuration = "Release"; }); - RunTests("./tests/SkiaSharp.Desktop.Tests/bin/AnyCPU/Release/SkiaSharp.Desktop.Tests.dll", false); + RunTests("./tests/SkiaSharp.Desktop.Tests/bin/AnyCPU/Release/SkiaSharp.Desktop.Tests.dll"); } // .NET Core RunDotNetCoreRestore ("./tests/SkiaSharp.NetCore.Tests"); @@ -664,8 +663,7 @@ Task ("Windows-CI") //////////////////////////////////////////////////////////////////////////////////////////////////// Information ("Cake.exe ToolPath: {0}", CakeToolPath); -Information ("Cake.exe TestConsoleToolPath_x86: {0}", TestConsoleToolPath_x86); -Information ("Cake.exe TestConsoleToolPath_x64: {0}", TestConsoleToolPath_x64); +Information ("Cake.exe NUnitConsoleToolPath: {0}", NUnitConsoleToolPath); Information ("NuGet.exe ToolPath: {0}", NugetToolPath); Information ("Xamarin-Component.exe ToolPath: {0}", XamarinComponentToolPath); Information ("genapi.exe ToolPath: {0}", GenApiToolPath); diff --git a/cake/UtilsManaged.cake b/cake/UtilsManaged.cake index 78bf3fab..101e212d 100644 --- a/cake/UtilsManaged.cake +++ b/cake/UtilsManaged.cake @@ -39,11 +39,11 @@ var RunProcess = new Action ((process, settings) => } }); -var RunTests = new Action ((testAssembly, is64) => +var RunTests = new Action ((testAssembly) => { var dir = testAssembly.GetDirectory (); - RunProcess (is64 ? TestConsoleToolPath_x64 : TestConsoleToolPath_x86, new ProcessSettings { - Arguments = string.Format ("\"{0}\"", testAssembly), + RunProcess (NUnitConsoleToolPath, new ProcessSettings { + Arguments = string.Format ("\"{0}\" --work=\"{1}\"", testAssembly, dir), }); }); diff --git a/tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.csproj b/tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.csproj index 4f70b09b..5aff5b90 100644 --- a/tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.csproj +++ b/tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.csproj @@ -1,6 +1,5 @@  - Debug @@ -74,6 +73,10 @@ true + + packages\NUnit.3.6.0\lib\net45\nunit.framework.dll + True + @@ -83,22 +86,6 @@ - - packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - @@ -285,12 +272,6 @@ - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - -