-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathcoverage.sh
More file actions
26 lines (20 loc) · 777 Bytes
/
coverage.sh
File metadata and controls
26 lines (20 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
dotnet tool list -g dotnet-reportgenerator-globaltool > /dev/null 2>&1
exists=$(echo $?)
if [ $exists -ne 0 ]; then
echo "Installing ReportGenerator..."
dotnet tool install -g dotnet-reportgenerator-globaltool
echo "ReportGenerator installed"
fi
find . -type d -name TestResults -exec rm -rf {} \; > /dev/null 2>&1
testtarget="$1"
if [ "$testtarget" = "" ]; then
testtarget="ci.slnf"
fi
dotnet build $testtarget --configuration Release
dotnet test $testtarget --configuration Release --no-build --no-restore --framework net9.0 --collect:"XPlat Code Coverage;Format=opencover"
reportgenerator \
-reports:tests/**/coverage.opencover.xml \
-targetdir:TestResults \
-reporttypes:"Html;Badges;MarkdownSummaryGithub" \
-assemblyfilters:-*Tests*