Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

dotcover: dotcover print coverage results using cmd line


# first run the tests with coverage, generating a snapshot
dotcover cover 
    --targetExecutable="nunit3-console.exe" 
    --targetArguments="..." 
    --output="coverage-results.snapshot"

# then, generate the JSON report 
dotcover report --Source="results.snapshot" --Output="coverage-results.json" --ReportType="JSON"

# then, generate the HTML report (a nice way of examining results manually)
dotcover report --Source="results.snapshot" --Output="coverage-results.html" --ReportType="HTML"

# Read the JSON file (my runners are on windows, so I'm using powershell)
$coverageJson = (Get-Content "coverage-results.json" -Raw) | ConvertFrom-Json

# Print the top level coverage result
Write-Host "Statements: $($coverageJson.CoveragePercent)%"

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x