diff --git a/build.cake b/build.cake index a3d7cf64d2..e902c5d24e 100644 --- a/build.cake +++ b/build.cake @@ -662,11 +662,9 @@ Task("Run-Unit-Tests") if (isRunningOnWindows) { - var windowsTests = GetFiles("./tests/Avalonia.DesignerSupport.Tests/bin/" + dirSuffix + "/*.Tests.dll") + - GetFiles("./tests/Avalonia.LeakTests/bin/" + dirSuffix + "/*.LeakTests.dll") + - GetFiles("./tests/Avalonia.RenderTests/bin/" + dirSuffix + "/*.RenderTests.dll"); + var leakTests = GetFiles("./tests/Avalonia.LeakTests/bin/" + dirSuffix + "/*.LeakTests.dll"); - unitTests.AddRange(windowsTests); + unitTests.AddRange(leakTests); } var toolPath = (isPlatformAnyCPU || isPlatformX86) ? @@ -688,20 +686,32 @@ Task("Run-Unit-Tests") .WithFilter("-[Avalonia.*]OmniXaml.* -[Avalonia.*]Glass.*") .WithFilter("-[Avalonia.HtmlRenderer]TheArtOfDev.HtmlRenderer.* +[Avalonia.HtmlRenderer]TheArtOfDev.HtmlRenderer.Avalonia.* -[Avalonia.ReactiveUI]*"); - foreach(var test in unitTests) + openCoverSettings.ReturnTargetCodeOffset = 0; + + foreach(var test in unitTests.Where(testFile => FileExists(testFile))) { CopyDirectory(test.GetDirectory(), testsRoot); } + var testsInDirectoryToRun = new List(); + if(isRunningOnWindows) + { + testsInDirectoryToRun.AddRange(GetFiles("./artifacts/tests/*Tests.dll")); + } + else + { + testsInDirectoryToRun.AddRange(GetFiles("./artifacts/tests/*.UnitTests.dll")); + } + if(isRunningOnWindows) { OpenCover(context => { - context.XUnit2(unitTests.Select(test => testsRoot.GetFilePath(test).FullPath), xUnitSettings); + context.XUnit2(testsInDirectoryToRun, xUnitSettings); }, openCoverOutput, openCoverSettings); } else { - XUnit2(unitTests.Select(test => test.FullPath), xUnitSettings); + XUnit2(testsInDirectoryToRun, xUnitSettings); } }); diff --git a/src/Skia/Avalonia.Skia/FormattedTextImpl.cs b/src/Skia/Avalonia.Skia/FormattedTextImpl.cs index 51f4b2b724..7e70f9354e 100644 --- a/src/Skia/Avalonia.Skia/FormattedTextImpl.cs +++ b/src/Skia/Avalonia.Skia/FormattedTextImpl.cs @@ -585,7 +585,7 @@ namespace Avalonia.Skia if (_skiaLines.Count == 0) { _lines.Add(new FormattedTextLine(0, _lineHeight)); - _size = new Size(0, _lineHeight + lastLineDescent); + _size = new Size(0, _lineHeight); } else { diff --git a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj index 49d7f44102..3519590080 100644 --- a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj +++ b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj @@ -18,7 +18,7 @@ true full false - bin\Debug\ + ..\..\artifacts\tests\ DEBUG;TRACE prompt 4 @@ -27,7 +27,7 @@ AnyCPU pdbonly true - bin\Release\ + ..\..\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 7a1c1207ce..97dfda5967 100644 --- a/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj +++ b/tests/Avalonia.DesignerSupport.Tests/Avalonia.DesignerSupport.Tests.csproj @@ -16,7 +16,7 @@ true full false - bin\Debug\ + ..\..\artifacts\tests\ DEBUG;TRACE prompt 4 @@ -24,7 +24,7 @@ pdbonly true - bin\Release\ + ..\..\artifacts\tests\ TRACE prompt 4 @@ -69,6 +69,12 @@ + + + {f1381f98-4d24-409a-a6c5-1c5b1e08bb08} + Avalonia.DesignerSupport.TestApp + +