Skip to content

Commit

Permalink
Add TeamCity to output formats (#16)
Browse files Browse the repository at this point in the history
Implements #15
  • Loading branch information
flcdrg authored and Romanx committed Dec 11, 2018
1 parent e33d9f5 commit aa288f1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
28 changes: 16 additions & 12 deletions src/Cake.Coverlet/CoverletOutputFormat.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
using System;

namespace Cake.Coverlet
namespace Cake.Coverlet
{
/// <summary>
/// Maps to the output formats provided by Coverlet
/// <summary>
/// Maps to the output formats provided by Coverlet
/// </summary>
[Flags]
public enum CoverletOutputFormat
{
/// <summary>
/// Json
/// <summary>
/// Json
/// </summary>
json = 0x1,
/// <summary>
/// Lcov
/// <summary>
/// Lcov
/// </summary>
lcov = 0x2,
/// <summary>
/// Opencover
/// <summary>
/// Opencover
/// </summary>
opencover = 0x4,
/// <summary>
/// Cobertura
/// <summary>
/// Cobertura
/// </summary>
cobertura = 0x8
cobertura = 0x8,
/// <summary>
/// TeamCity
/// </summary>
teamcity = 0x10
}
}
17 changes: 16 additions & 1 deletion test/Cake.Coverlet.Tests/CoverletToolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public CoverletToolTest(CoverletToolFixture fixture)
}

[Fact]
public void AbsolutePath_Should_Be_Pased()
public void AbsolutePath_Should_Be_Passed()
{
_fixture.Settings = new CoverletSettings();
_fixture.TestFile = "./test/Cake.Coverlet.Tests/bin/Debug/netcoreapp2.1/Cake.Coverlet.Tests.dll";
Expand All @@ -26,5 +26,20 @@ public void AbsolutePath_Should_Be_Pased()
result.Args.Should().Contain("--targetargs \"test /Working/test/Cake.Coverlet.Tests --no-build\"");
result.Args.Should().Contain("--format json");
}

[Fact]
public void OutputFormat_Supports_TeamCity()
{
_fixture.Settings = new CoverletSettings
{
CoverletOutputFormat = CoverletOutputFormat.teamcity
};
_fixture.TestFile = "./test/Cake.Coverlet.Tests/bin/Debug/netcoreapp2.1/Cake.Coverlet.Tests.dll";
_fixture.TestProject = "./test/Cake.Coverlet.Tests/";

var result = _fixture.Run();

result.Args.Should().Contain("--format teamcity");
}
}
}

0 comments on commit aa288f1

Please sign in to comment.