Skip to content

Commit

Permalink
add ut script
Browse files Browse the repository at this point in the history
  • Loading branch information
RayWangQvQ committed May 20, 2024
1 parent 0e2d15c commit ca2a7b2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/ut.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Set-Location ..

# 安装 ReportGenerator 工具
Write-Output "Installing ReportGenerator tool..."
dotnet tool install -g dotnet-reportgenerator-globaltool

# 运行单元测试并生成覆盖率报告
Write-Output "Running unit tests and generating coverage report..."
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

# 生成 HTML 格式的覆盖率报告
Write-Output "Generating HTML coverage report..."
reportgenerator "-reports:TestResults/*/coverage.opencover.xml" "-targetdir:coveragereport" -reporttypes:Html

# 打开生成的覆盖率报告
Write-Output "Opening coverage report..."
Start-Process "coveragereport/index.htm"

0 comments on commit ca2a7b2

Please sign in to comment.