diff --git a/build.cake b/build.cake index 9f08f37fd3..2be3dd3a17 100644 --- a/build.cake +++ b/build.cake @@ -629,13 +629,9 @@ Task("Build") Task("Run-Unit-Tests") .IsDependentOn("Build") + .WithCriteria(() => !skipTests) .Does(() => { - if(skipTests) - { - Information("Skipping unit tests because of -skip-tests"); - return; - } var pattern = "./tests/Avalonia.*.UnitTests/bin/" + dirSuffix + "/Avalonia.*.UnitTests.dll"; Func ExcludeWindowsTests = i => {