diff --git a/appveyor.yml b/appveyor.yml index 746ded971d..76d1ae3e1c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ install: before_build: - git submodule update --init build_script: -- ps: .\build.ps1 -Target "AppVeyor" -Platform "$env:platform" -Configuration "$env:configuration" -v Diagnostic +- ps: .\build.ps1 -Target "AppVeyor" -Platform "$env:platform" -Configuration "$env:configuration" test: off artifacts: diff --git a/build.cake b/build.cake index 06ba84e27f..d321109a1e 100644 --- a/build.cake +++ b/build.cake @@ -143,8 +143,8 @@ Task("Build") settings.WithProperty("Platform", "\"" + parameters.Platform + "\""); settings.WithProperty("UseRoslynPathHack", "true"); settings.SetVerbosity(Verbosity.Minimal); - settings.WithProperty("Windows", "True"); settings.UseToolVersion(MSBuildToolVersion.VS2017); + settings.WithProperty("Windows", "True"); settings.SetNodeReuse(false); }); } @@ -178,8 +178,11 @@ void RunCoreTest(string project, Parameters parameters, bool coreOnly = false) } } -Task("Run-Net-Core-Unit-Tests") - .IsDependentOn("Clean") +Task("Run-Unit-Tests") + .IsDependentOn("Build") + .IsDependentOn("Run-Designer-Unit-Tests") + .IsDependentOn("Run-Render-Tests") + .WithCriteria(() => !parameters.SkipTests) .Does(() => { RunCoreTest("./tests/Avalonia.Base.UnitTests", parameters, false); RunCoreTest("./tests/Avalonia.Controls.UnitTests", parameters, false); @@ -190,56 +193,22 @@ Task("Run-Net-Core-Unit-Tests") RunCoreTest("./tests/Avalonia.Markup.Xaml.UnitTests", parameters, false); RunCoreTest("./tests/Avalonia.Styling.UnitTests", parameters, false); RunCoreTest("./tests/Avalonia.Visuals.UnitTests", parameters, false); - if(parameters.IsRunningOnWindows) - RunCoreTest("./tests/Avalonia.RenderTests/Avalonia.Skia.RenderTests.csproj", parameters, true); }); -Task("Run-Unit-Tests") - .IsDependentOn("Run-Net-Core-Unit-Tests") +Task("Run-Render-Tests") .IsDependentOn("Build") - //.IsDependentOn("Run-Leak-Tests") - .WithCriteria(() => !parameters.SkipTests) + .WithCriteria(() => !parameters.SkipTests && parameters.IsRunningOnWindows) + .Does(() => { + RunCoreTest("./tests/Avalonia.RenderTests/Avalonia.Skia.RenderTests.csproj", parameters, true); + RunCoreTest("./tests/Avalonia.RenderTests/Avalonia.Direct2D1.RenderTests.csproj", parameters, true); + }) + +Task("Run-Designer-Unit-Tests") + .IsDependentOn("Build") + .WithCriteria(() => !parameters.SkipTests && parameters.IsRunningOnWindows) .Does(() => { - if(!parameters.IsRunningOnWindows) - return; - - var unitTests = GetDirectories("./tests/Avalonia.*.UnitTests") - .Select(dir => System.IO.Path.GetFileName(dir.FullPath)) - .Where( name => !name.Contains("Skia")) // Run in the Run-Net-Core-Unit-Tests target - .Where(name => parameters.IsRunningOnWindows ? true : !name.Contains("Direct2D")) - .Select(name => MakeAbsolute(File("./tests/" + name + "/bin/" + parameters.DirSuffix + "/" + name + ".dll"))) - .ToList(); - - var toolPath = (parameters.IsPlatformAnyCPU || parameters.IsPlatformX86) ? - Context.Tools.Resolve("xunit.console.x86.exe") : - Context.Tools.Resolve("xunit.console.exe"); - - var xUnitSettings = new XUnit2Settings - { - ToolPath = toolPath, - Parallelism = ParallelismOption.None, - ShadowCopy = false - }; - - xUnitSettings.NoAppDomain = !parameters.IsRunningOnWindows; - - foreach(var test in unitTests.Where(testFile => FileExists(testFile))) - { - CopyDirectory(test.GetDirectory(), parameters.TestsRoot); - } - - var testsInDirectoryToRun = new List(); - if(parameters.IsRunningOnWindows) - { - testsInDirectoryToRun.AddRange(GetFiles("./artifacts/tests/*Tests.dll")); - } - else - { - testsInDirectoryToRun.AddRange(GetFiles("./artifacts/tests/*.UnitTests.dll")); - } - - XUnit2(testsInDirectoryToRun, xUnitSettings); + XUnit2(GetFiles("./artifacts/designer-tests/Avalonia.DesignerSupport.Tests.csproj"), xUnitSettings); }); Task("Copy-Files") @@ -427,7 +396,7 @@ Task("Default").Does(() => if(parameters.IsRunningOnWindows) RunTarget("Package"); else - RunTarget("Run-Net-Core-Unit-Tests"); + RunTarget("Run-Unit-Tests"); }); Task("AppVeyor") .IsDependentOn("Zip-Files") @@ -435,7 +404,7 @@ Task("AppVeyor") .IsDependentOn("Publish-NuGet"); Task("Travis") - .IsDependentOn("Run-Net-Core-Unit-Tests"); + .IsDependentOn("Run-Unit-Tests"); /////////////////////////////////////////////////////////////////////////////// // EXECUTE diff --git a/src/Android/Avalonia.Android/Resources/Resource.Designer.cs b/src/Android/Avalonia.Android/Resources/Resource.Designer.cs index e66c2800d3..80cbbc51ec 100644 --- a/src/Android/Avalonia.Android/Resources/Resource.Designer.cs +++ b/src/Android/Avalonia.Android/Resources/Resource.Designer.cs @@ -40,14 +40,11 @@ namespace Avalonia.Android public partial class String { - // aapt resource value: 0x7f020002 - public static int ApplicationName = 2130837506; - // aapt resource value: 0x7f020001 - public static int Hello = 2130837505; + public static int ApplicationName = 2130837505; // aapt resource value: 0x7f020000 - public static int library_name = 2130837504; + public static int Hello = 2130837504; static String() { diff --git a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj index eaae82316e..fbbd5f0b28 100644 --- a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj +++ b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj @@ -13,13 +13,13 @@ 512 true + ..\..\artifacts\designer-tests\ AnyCPU true full false - ..\..\artifacts\tests\ DEBUG;TRACE prompt 4 @@ -28,7 +28,6 @@ AnyCPU pdbonly true - ..\..\artifacts\tests\ TRACE prompt 4 diff --git a/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj b/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj index bc9a4b3e29..4ce24e1d4c 100644 --- a/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj +++ b/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj @@ -12,12 +12,12 @@ v4.7 512 + ..\..\artifacts\designer-tests\ true full false - ..\..\artifacts\tests\ DEBUG;TRACE prompt 4 @@ -25,7 +25,6 @@ pdbonly true - ..\..\artifacts\tests\ TRACE prompt 4 diff --git a/tests/Avalonia.RenderTests/Avalonia.Direct2D1.RenderTests.csproj b/tests/Avalonia.RenderTests/Avalonia.Direct2D1.RenderTests.csproj index 03f5233546..6af8fd8963 100644 --- a/tests/Avalonia.RenderTests/Avalonia.Direct2D1.RenderTests.csproj +++ b/tests/Avalonia.RenderTests/Avalonia.Direct2D1.RenderTests.csproj @@ -1,106 +1,39 @@ - - + - Debug - AnyCPU - {DABFD304-D6A4-4752-8123-C2CCF7AC7831} - Library - Properties - Avalonia.Direct2D1.RenderTests - Avalonia.Direct2D1.RenderTests - v4.7 - 512 - - - - true - full - false - ..\..\artifacts\tests\ - DEBUG;TRACE - prompt - 4 - CS1591 + obj-Direct2D1 - - pdbonly - true - ..\..\artifacts\tests\ - TRACE - prompt - 4 + + + netcoreapp2.0 + bin\Direct2D\$(Configuration) + false + False + $(DefineConstants);AVALONIA_DIRECT2D + Library - - - - - - {D211E587-D8BC-45B9-95A4-F297C8FA5200} - Avalonia.Animation - - - {B09B78D8-9B26-48B0-9149-D64A2F120F3F} - Avalonia.Base - - - {D2221C82-4A25-4583-9B43-D791E3F6820C} - Avalonia.Controls - - - {3E908F67-5543-4879-A1DC-08EACE79B3CD} - Avalonia.Direct2D1 - - - {62024B2D-53EB-4638-B26B-85EEAA54866E} - Avalonia.Input - - - {6B0ED19D-A08B-461C-A9D9-A9EE40B0C06B} - Avalonia.Interactivity - - - {42472427-4774-4C81-8AFF-9F27B8E31721} - Avalonia.Layout - - - {EB582467-6ABB-43A1-B052-E981BA910E3A} - Avalonia.Visuals - - - {F1BAA01A-F176-4C6A-B39D-5B40BB1B148F} - Avalonia.Styling - - - - + + - - 4.3.0 - + + + + + + + + + + + + + + + + - - - - - False - - - False - - - False - - - False - - - - - - - + \ No newline at end of file diff --git a/tests/Avalonia.RenderTests/TestBase.cs b/tests/Avalonia.RenderTests/TestBase.cs index 84860eefdb..dd6fcb1c06 100644 --- a/tests/Avalonia.RenderTests/TestBase.cs +++ b/tests/Avalonia.RenderTests/TestBase.cs @@ -46,9 +46,7 @@ namespace Avalonia.Direct2D1.RenderTests public TestBase(string outputPath) { -#if AVALONIA_CAIRO - string testFiles = Path.GetFullPath(@"..\..\tests\TestFiles\Cairo"); -#elif AVALONIA_SKIA +#if AVALONIA_SKIA string testFiles = Path.GetFullPath(@"..\..\..\..\..\TestFiles\Skia"); #else string testFiles = Path.GetFullPath(@"..\..\tests\TestFiles\Direct2D1");