All Projects → Romanx → Cake.Coverlet

Romanx / Cake.Coverlet

Licence: MIT License
Coverlet extensions for Cake Build

Programming Languages

C#
18002 projects
powershell
5483 projects
shell
77523 projects

Projects that are alternatives of or similar to Cake.Coverlet

Cols Agent Tasks
Colin's ALM Corner Custom Build Tasks
Stars: ✭ 70 (+79.49%)
Mutual labels:  coverage, build
Cargo Make
Rust task runner and build tool.
Stars: ✭ 895 (+2194.87%)
Mutual labels:  coverage, build
Gogradle
A Gradle Plugin Providing Full Support for Go
Stars: ✭ 712 (+1725.64%)
Mutual labels:  coverage, build
Coverlet
Cross platform code coverage for .NET
Stars: ✭ 2,303 (+5805.13%)
Mutual labels:  coverage, coverlet
covviz
Multi-sample genome coverage viewer to observe large, coverage-based anomalies alongside annotations and sample metadata
Stars: ✭ 42 (+7.69%)
Mutual labels:  coverage
cargo-llvm-cov
Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Stars: ✭ 181 (+364.1%)
Mutual labels:  coverage
bzl
Bzl - Integrated CLI + UI + VSCode Extension for Bazel
Stars: ✭ 43 (+10.26%)
Mutual labels:  build
example-node-and-browser-qunit-ci
Example project with continuous integration for linting and cross-browser testing of isomorphic JavaScript.
Stars: ✭ 18 (-53.85%)
Mutual labels:  coverage
ddd-net-ef-core
Self study: DDD, .net core, entity framework core
Stars: ✭ 41 (+5.13%)
Mutual labels:  coverlet
cresset
Template repository to build PyTorch projects from source on any version of PyTorch/CUDA/cuDNN.
Stars: ✭ 573 (+1369.23%)
Mutual labels:  build
asap
A cmake starter project for C++ with basic infrastructure including platform detection, compiler detection, assertions..., and a complete build lifecycle. Portable across Linux, OS X and Windows.
Stars: ✭ 39 (+0%)
Mutual labels:  build
instrumentation
Assorted pintools
Stars: ✭ 24 (-38.46%)
Mutual labels:  coverage
RocketXPlugin
🔥🔥 android 端编译加速插件🚀 自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
Stars: ✭ 408 (+946.15%)
Mutual labels:  build
Cake.Docker
Cake AddIn that extends Cake with Docker
Stars: ✭ 45 (+15.38%)
Mutual labels:  cake
libfuzzer-cov
Get actually nice HTML coverage overview on libfuzzer runs
Stars: ✭ 20 (-48.72%)
Mutual labels:  coverage
angular-package-builder
[DEPRECATED] Packages your Angular 4+ library based on the Angular Package Format.
Stars: ✭ 25 (-35.9%)
Mutual labels:  build
build-plugin
Track your build performances like never before.
Stars: ✭ 45 (+15.38%)
Mutual labels:  build
pancakeswap-lottery
🥞 A Python client for accessing PancakeSwap Lottery smart contract information through Web3.py
Stars: ✭ 30 (-23.08%)
Mutual labels:  cake
SubmiBot
Plugin do Eclipse para automatização do processo de submissão de tarefas na disciplina de LP2 - Computação@UFCG
Stars: ✭ 16 (-58.97%)
Mutual labels:  build
jagen
A software engineer's workspace manager and build systems wrapper
Stars: ✭ 32 (-17.95%)
Mutual labels:  build

Cake.Coverlet

Build status NuGet version

Usage

In order to use the addin please make sure you've included Coverlet in the project you wish to cover and add the following to your cake build file

#addin nuget:?package=Cake.Coverlet

You can also install coverlet as a global tool on your machine or with the Cake.DotNetTool.Module and run the command separately from MSBuild.

Note: Works with Coverlet 2.1.1 and up

Then use one of the following snippets

Task("Test")
    .IsDependentOn("Build")
    .Does<MyBuildData>((data) =>
{
    var testSettings = new DotNetCoreTestSettings {
    };

    var coverletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}"
    };

    DotNetCoreTest("./test/My.Project.Tests/My.Project.Tests.csproj", testSetting, coverletSettings);
}

Or for when installed as a tool:

Task("Test")
    .IsDependentOn("Build")
    .Does<MyBuildData>((data) =>
{
    var coverletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}"
    };

    // I want to specify the specific dll file and the project exactly.
    Coverlet(
        "./test/My.Project.Tests/bin/Debug/net46/My.Project.Tests.dll", 
        "./test/My.Project.Tests/My.Project.Tests.csproj", 
        coverletSettings);

    // I want to specify just the project file and the dll can be
    // inferred from the name of the project file.
    Coverlet(
        "./test/My.Project.Tests/My.Project.Tests.csproj", 
        coverletSettings);

    // I want to specify just the project directory, we will discover
    // any proj file in the directory (take the first) and infer the 
    // name from the found project.
    Coverlet(
        "./test/My.Project.Tests",
        coverletSettings);
}

There is an additional api exposed for transforming the output name of the coverage file at the time of calling dotnet test. This transform function follows the form Func<string, string> being passed the CoverletOutputName and the return is used for the filename.

Task("Test")
    .IsDependentOn("Build")
    .Does<MyBuildData>((data) =>
{
    var testSettings = new DotNetCoreTestSettings {
    };

    var coverletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results"
        OutputNameTransformer = (fileName, directory) => $@"{directory}\{fileName}-HelloWorld"
    };

    DotNetCoreTest("./test/Stubble.Core.Tests/Stubble.Core.Tests.csproj", testSetting, coverletSettings);
}

We expose a default transformer for the standard practice of appending the current datetime to the file as WithDateTimeTransformer()

If you wish to only change the directory that the output is written to then set the CoverletOutputDirectory and the filename handling will be done by coverlet as usual.

Setting more than one output format

You can support multiple coverlet formats by providing them like this:

var coverletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover | CoverletOutputFormat.cobertura,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}"
    };

Or by using the method on the settings class like this:

var coverletSettings = new CoverletSettings {
        CollectCoverage = true,
        CoverletOutputFormat = CoverletOutputFormat.opencover,
        CoverletOutputDirectory = Directory(@".\coverage-results\"),
        CoverletOutputName = $"results-{DateTime.UtcNow:dd-MM-yyyy-HH-mm-ss-FFF}"
    }.WithFormat(CoverletOutputFormat.cobertura);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].