forked from googleapis/google-cloud-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runcoverage.sh
40 lines (29 loc) · 1.01 KB
/
runcoverage.sh
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
source toolversions.sh
install_dotcover
# We use the dotCover CLI for coverage.
# Other options considered include OpenCover, but that doesn't support portable PDBs.
# See https://github.com/OpenCover/opencover/issues/601 for current status of OpenCover,
# although now dotCover is working, we probably won't change back.
# Run unit tests with coverage. We expect this script
# only to be executed on Windows, and only after build.sh
# has been run (so we already have an AllTests.txt file).
# Disable automatic test reporting to AppVeyor.
# See https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/1232
unset APPVEYOR_API_URL
if [ ! -d coverage ]
then
mkdir coverage
fi
while read csproj
do
testdir=$(dirname $csproj)
api=$(basename $(realpath $testdir/..))
echo "Scanning for $testdir/coverage.xml"
[ ! -f "$testdir/coverage.xml" ] && continue
pushd "$testdir"
echo "Running coverage for $api"
$DOTCOVER cover "coverage.xml" /ReturnTargetExitCode
popd
done < AllTests.txt