forked from cake-build/cake
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.25.0' into main
* release/0.25.0: (build) Updated version and release notes. cake-buildGH-1997: Add support for --trace command line option for NUnit3 settings + runner (cake-buildGH-1995) Make In-Proc NuGet addin/tool installtion default Adds missing .NET CLI dependencies/restore switches (cake-buildGH-1937) Speed up in-process NuGet Update MSBuildVerbosityExtensions.cs (cake-buildGH-1992) Update to .NET Core 1.0.9 / SDK 1.1.7 cake-buildGH-1987: Normalize exception handling in PropertyToken for invalid parameter index [ci skip] Get more Open Source Helpers Removed unnecessary parameter Fix writing start and end progress messages (cake-buildGH-1974) Added System.Collections work around for Mono (cake-buildGH-1689) Add documentation that Chocolatey licensed is required (build) Updated Cake tool to version 0.24.0
- Loading branch information
Showing
47 changed files
with
764 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"projects": [ "src" ], | ||
"sdk": { | ||
"version": "1.1.5" | ||
"version": "1.1.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/Cake.Common.Tests/Unit/Tools/MSBuild/MSBuildVerbosityExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Linq; | ||
using Cake.Common.Tools.MSBuild; | ||
using Cake.Core; | ||
using Cake.Core.Diagnostics; | ||
using Xunit; | ||
|
||
namespace Cake.Common.Tests.Unit.Tools.MSBuild | ||
{ | ||
public sealed class MSBuildVerbosityExtensionsTests | ||
{ | ||
public sealed class GetMSBuildVerbosityMethod | ||
{ | ||
[Theory] | ||
[InlineData("quiet", Verbosity.Quiet)] | ||
[InlineData("minimal", Verbosity.Minimal)] | ||
[InlineData("normal", Verbosity.Normal)] | ||
[InlineData("detailed", Verbosity.Verbose)] | ||
[InlineData("diagnostic", Verbosity.Diagnostic)] | ||
public void Should_Convert_Valid_String_To_Verbosity_Enum(string verbosityName, Verbosity expectedVerbosity) | ||
{ | ||
// Given | ||
|
||
// When | ||
var actualVerbosity = MSBuildVerbosityExtensions.GetMSBuildVerbosity(verbosityName); | ||
|
||
// Then | ||
Assert.Equal(expectedVerbosity, actualVerbosity); | ||
} | ||
|
||
[Theory] | ||
[InlineData("QUIET", Verbosity.Quiet)] | ||
[InlineData("MINIMAL", Verbosity.Minimal)] | ||
[InlineData("NORMAL", Verbosity.Normal)] | ||
[InlineData("DETAILED", Verbosity.Verbose)] | ||
[InlineData("DIAGNOSTIC", Verbosity.Diagnostic)] | ||
public void Should_Convert_Valid_UpperCase_String_To_Verbosity_Enum(string verbosityName, Verbosity expectedVerbosity) | ||
{ | ||
// Given | ||
|
||
// When | ||
var actualVerbosity = MSBuildVerbosityExtensions.GetMSBuildVerbosity(verbosityName); | ||
|
||
// Then | ||
Assert.Equal(expectedVerbosity, actualVerbosity); | ||
} | ||
|
||
[Fact] | ||
public void Should_Throws_Exception_When_Parameter_Is_Null() | ||
{ | ||
// Given | ||
|
||
// When | ||
var actualException = Assert.Throws<CakeException>(() => MSBuildVerbosityExtensions.GetMSBuildVerbosity(null)); | ||
|
||
// Then | ||
Assert.Equal("Encountered unknown MSBuild build log verbosity ''. Valid values are 'quiet', 'minimal', 'normal', 'detailed' and 'diagnostic'.", actualException.Message); | ||
} | ||
|
||
[Theory] | ||
[InlineData("", "Encountered unknown MSBuild build log verbosity ''. Valid values are 'quiet', 'minimal', 'normal', 'detailed' and 'diagnostic'.")] | ||
[InlineData("invalid", "Encountered unknown MSBuild build log verbosity 'invalid'. Valid values are 'quiet', 'minimal', 'normal', 'detailed' and 'diagnostic'.")] | ||
public void Should_Throws_Exception_When_Parameter_Has_Invalid_Value(string invalidVerbosityValue, string expectedMessage) | ||
{ | ||
// Given | ||
|
||
// When | ||
var actualException = Assert.Throws<CakeException>(() => MSBuildVerbosityExtensions.GetMSBuildVerbosity(invalidVerbosityValue)); | ||
|
||
// Then | ||
Assert.Equal(expectedMessage, actualException.Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/Cake.Common.Tests/Unit/Tools/NUnit/NUnitInternalTraceLevelExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using Cake.Common.Tools.NUnit; | ||
using Xunit; | ||
|
||
namespace Cake.Common.Tests.Unit.Tools.NUnit | ||
{ | ||
public sealed class NUnitInternalTraceLevelExtensionsTests | ||
{ | ||
public sealed class TheGetArgumentValueMethod | ||
{ | ||
[Theory] | ||
[InlineData(NUnitInternalTraceLevel.Off, "off")] | ||
[InlineData(NUnitInternalTraceLevel.Error, "error")] | ||
[InlineData(NUnitInternalTraceLevel.Warning, "warning")] | ||
[InlineData(NUnitInternalTraceLevel.Info, "info")] | ||
[InlineData(NUnitInternalTraceLevel.Debug, "verbose")] | ||
#pragma warning disable xUnit1025 // InlineData should be unique within the Theory it belongs to | ||
[InlineData(NUnitInternalTraceLevel.Verbose, "verbose")] | ||
#pragma warning restore xUnit1025 // InlineData should be unique within the Theory it belongs to | ||
public void Should_Return_Correct_Value(NUnitInternalTraceLevel level, string expected) | ||
{ | ||
// Given, When | ||
var result = level.GetArgumentValue(); | ||
|
||
// Then | ||
Assert.Equal(expected, result); | ||
} | ||
|
||
[Fact] | ||
public void Should_Throw_On_Unexpected_Value() | ||
{ | ||
// Given | ||
var level = (NUnitInternalTraceLevel)128; | ||
|
||
// When | ||
var ex = Record.Exception(() => level.GetArgumentValue()); | ||
|
||
// Then | ||
Assert.IsType<ArgumentOutOfRangeException>(ex); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.