-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage collection & reporting
- Loading branch information
Showing
8 changed files
with
48 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-reportgenerator-globaltool": { | ||
"version": "5.1.22", | ||
"commands": [ | ||
"reportgenerator" | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -370,3 +370,4 @@ __pycache__/ | |
|
||
temp/ | ||
tmp/ | ||
etc/coverage/ |
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,7 @@ | ||
<RunSettings> | ||
<DataCollectionRunSettings> | ||
<DataCollectors> | ||
<DataCollector friendlyName="XPlat Code Coverage" /> | ||
</DataCollectors> | ||
</DataCollectionRunSettings> | ||
</RunSettings> |
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,17 +1,13 @@ | ||
@echo off | ||
pushd "%~dp0" | ||
call :main %* | ||
popd | ||
goto :EOF | ||
|
||
:main | ||
call build ^ | ||
&& call :test Debug -p:CollectCoverage=true ^ | ||
-p:CoverletOutputFormat=opencover ^ | ||
-p:Exclude=[NUnit*]* ^ | ||
&& call :test Release | ||
goto :EOF | ||
dotnet tool restore ^ | ||
&& call build ^ | ||
&& call :test Debug ^ | ||
&& call :test Release ^ | ||
&& dotnet reportgenerator -reports:NCrontab.Tests\TestResults\*\coverage.cobertura.xml -targetdir:etc\coverage -reporttypes:TextSummary;Html ^ | ||
&& type etc\coverage\Summary.txt | ||
popd && exit /b %ERRORLEVEL% | ||
|
||
:test | ||
dotnet test --no-build -c %1 NCrontab.Tests | ||
dotnet test --no-build -s NCrontab.Tests\.runsettings -c %* | ||
goto :EOF |
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,12 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
cd "$(dirname "$0")" | ||
dotnet tool restore | ||
./build.sh | ||
for f in net7.0 net6.0; do { | ||
dotnet test --no-build NCrontab.Tests -c Debug -f $f \ | ||
-p:CollectCoverage=true \ | ||
-p:CoverletOutputFormat=opencover \ | ||
-p:Exclude=[NUnit*]* | ||
dotnet test --no-build NCrontab.Tests -c Release -f $f | ||
} | ||
for f in net7.0 net6.0; do | ||
for c in Debug Release; do | ||
dotnet test --no-build -c $c -f $f \ | ||
-s NCrontab.Tests/.runsettings | ||
done | ||
done | ||
dotnet reportgenerator '-reports:NCrontab.Tests/TestResults/*/coverage.cobertura.xml' \ | ||
-targetdir:etc/coverage \ | ||
'-reporttypes:TextSummary;Html' | ||
cat etc/coverage/Summary.txt |