All Projects → lucaslorentz → Minicover

lucaslorentz / Minicover

Licence: mit
Cross platform code coverage tool for .NET Core

Projects that are alternatives of or similar to Minicover

Coverlet
Cross platform code coverage for .NET
Stars: ✭ 2,303 (+1093.26%)
Mutual labels:  dotnet-core, coverage, code-coverage
Dnczeus
DncZeus 是一个基于ASP.NET Core 3 + Vue.js(iview-admin) 的前后端分离的通用后台权限(页面访问、操作按钮控制)管理系统框架。后端使用.NET Core 3 + Entity Framework Core构建,UI则是目前流行的基于Vue.js的iView(iview-admin)。项目实现了前后端的动态权限管理和控制以及基于JWT的用户令牌认证机制,让前后端的交互更流畅。码云镜像:https://gitee.com/rector/DncZeus 。演示地址(demo):
Stars: ✭ 1,104 (+472.02%)
Mutual labels:  dotnet-core, netcore, net-core
Simplcommerce
A simple, cross platform, modularized ecommerce system built on .NET Core
Stars: ✭ 3,474 (+1700%)
Mutual labels:  dotnet-core, netcore, net-core
Altcover
Cross-platform coverage gathering and processing tool set for .net/.net core and Mono
Stars: ✭ 344 (+78.24%)
Mutual labels:  dotnet-core, coverage, code-coverage
Razorlight
Template engine based on Microsoft's Razor parsing engine for .NET Core
Stars: ✭ 1,068 (+453.37%)
Mutual labels:  dotnet-core, netcore
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+3577.72%)
Mutual labels:  dotnet-core, net-core
Netcore Postgres Oauth Boiler
A basic .NET Core website boilerplate using PostgreSQL for storage, Adminer for db management, Let's Encrypt for SSL certificates and NGINX for routing.
Stars: ✭ 57 (-70.47%)
Mutual labels:  netcore, net-core
Reportgenerator
ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
Stars: ✭ 1,276 (+561.14%)
Mutual labels:  dotnet-core, code-coverage
Dotnetcore Microservices Poc
Very simplified insurance sales system made in a microservices architecture using .NET Core
Stars: ✭ 1,304 (+575.65%)
Mutual labels:  dotnet-core, netcore
Ddd Tdd Rich Domain Model Dojo Kata
DDD patterns implemented following TDD
Stars: ✭ 91 (-52.85%)
Mutual labels:  dotnet-core, coverage
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (-37.31%)
Mutual labels:  dotnet-core, netcore
Tweetinvi
Tweetinvi, an intuitive Twitter C# library for the REST and Stream API. It supports .NET, .NETCore, UAP (Xamarin)...
Stars: ✭ 812 (+320.73%)
Mutual labels:  dotnet-core, netcore
Micronetes
Micronetes is a local orchestrator inspired by kubernetes that makes developing and testing microservices and distributed applications easier.
Stars: ✭ 785 (+306.74%)
Mutual labels:  dotnet-core, netcore
Bashcov
Code coverage tool for Bash
Stars: ✭ 113 (-41.45%)
Mutual labels:  coverage, code-coverage
Elmahcore
ELMAH for Net.Standard and Net.Core
Stars: ✭ 127 (-34.2%)
Mutual labels:  netcore, net-core
Eventsourcing.netcore
Examples and Tutorials of Event Sourcing in .NET Core
Stars: ✭ 760 (+293.78%)
Mutual labels:  dotnet-core, netcore
Netcorebbs
ASP.NET Core Light forum NETCoreBBS
Stars: ✭ 483 (+150.26%)
Mutual labels:  dotnet-core, netcore
Single cov
Actionable code coverage.
Stars: ✭ 154 (-20.21%)
Mutual labels:  coverage, code-coverage
Utplsql
Testing Framework for PL/SQL
Stars: ✭ 402 (+108.29%)
Mutual labels:  coverage, code-coverage
Peasy.net
A business logic micro-framework for .NET and .NET Core
Stars: ✭ 406 (+110.36%)
Mutual labels:  dotnet-core, net-core

MiniCover

Code Coverage Tool for .NET Core

Build Status Nuget Coverage Status

Supported .NET Core SDKs

  • 2.1 (Global tool)
  • 2.2 (Global tool)
  • 3.0 (Global tool or local tool)
  • 3.1 (Global tool or local tool)
  • 5.0 (Global tool or local tool)

Installation

MiniCover can be installed as a global tool:

dotnet tool install --global minicover

Or local tool:

dotnet tool install minicover

Commands

This is a simplified documentation of MiniCover commands and options.

Use --help for more information:

minicover --help

When installed as local tool, MiniCover commands must be prefixed with dotnet. Example:

dotnet minicover --help

Instrument

minicover instrument

Use this command to instrument assemblies to record code coverage.

It is based on the following main options:

option description type default
sources source files to track coverage glob src/**/*.cs
exclude-sources exceptions to source option glob **/bin/**/*.cs and **/obj/**/*.cs
tests test files used to recognize test methods glob tests/**/*.cs and test/**/*.cs
exclude-tests exceptions to tests option glob **/bin/**/*.cs and **/obj/**/*.cs
assemblies assemblies considered for instrumentation glob **/*.dll
exclude-assemblies Exceptions to assemblies option glob **/obj/**/*.dll

Note 1: Assemblies not related to sources or tests are automatically ignored.

Note 2: Supported syntax for glob values.

Note 3: You can repeat glob options to represent multiple values. Example: --sources "a/**/*.cs" --sources "b/**/*.cs"

This command also generates a coverage.json file with information about the instrumented code.

Uninstrument

minicover uninstrument

Use this command to revert the instrumentation based on coverage.json file.

Make sure you call uninstrument before publishing or packing your application.

Reset

minicover reset

Use this command to reset the recorded coverage so far.

Report

minicover report

Use this command to print a coverage report in the console.

The command exits with failure if the coverage doesn't meet a specific threshold (90% by default).

More commands

  • cloverreport: Write an Clover-formatted XML report to file
  • coberturareport: Write a cobertura XML report to file
  • coverallsreport: Prepare and/or submit coveralls reports
  • htmlreport: Write html report to folder
  • opencoverreport: Write an OpenCover-formatted XML report to file
  • xmlreport: Write an NCover-formatted XML report to file

Use --help for more information.

Build script example

dotnet restore
dotnet build

# Instrument
minicover instrument

# Reset hits
minicover reset

dotnet test --no-build

# Uninstrument
minicover uninstrument

# Create html reports inside folder coverage-html
minicover htmlreport --threshold 90

# Console report
minicover report --threshold 90

Ignore coverage files

Add the following to your .gitignore file to ignore code coverage results:

coverage-html
coverage-hits
coverage.json

Libraries

When using MiniCover libraries:

  • use dependency injection to create instances
  • use only the main interfaces listed on each package below

By doing that, you reduce the risk of being impacted by future MiniCover changes.

MiniCover.Core

Main MiniCover operations.

Dependency injection configuration:

services.AddMiniCoverCore();

Main interfaces:

  • IInstrumenter
  • IUninstrumenter
  • IHitsReader
  • IHitsResetter

MiniCover.Reports

MiniCover reports.

Dependency injection configuration:

services.AddMiniCoverCore();
services.AddMiniCoverReports();

Main interfaces:

  • ICloverReport
  • ICoberturaReport
  • IConsoleReport
  • ICoverallsReport
  • IHtmlReport
  • IHtmlSourceFileReport
  • INCoverReport
  • IOpenCoverReport
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].