-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cmd
30 lines (27 loc) · 829 Bytes
/
test.cmd
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
@echo off
pushd "%~dp0"
call :main %*
popd
goto :EOF
:main
call build ^
&& call :test Debug --settings tests\coverlet.runsettings ^
&& call :report-coverage ^
&& call :test Release
goto :EOF
:test
dotnet test --no-build tests -c %*
goto :EOF
:report-coverage
set TEST_RESULTS_DIR=
for /f %%d in ('dir /b /od /ad tests\TestResults') do set TEST_RESULTS_DIR=tests\TestResults\%%~d
if not defined TEST_RESULTS_DIR (
echo>&2 Test coverage XML not found!
exit /b 1
)
copy "%TEST_RESULTS_DIR%\coverage.opencover.xml" tests\TestResults > nul ^
&& dotnet reportgenerator -reports:tests\TestResults\coverage.opencover.xml ^
-reporttypes:Html;TextSummary ^
-targetdir:tests\TestResults\reports ^
&& type tests\TestResults\reports\Summary.txt
goto :EOF