Move unit testing into the make script.

This commit is contained in:
Matthias Mailänder
2023-05-23 22:12:25 +02:00
committed by abcdefg30
parent 5bcb1a678c
commit de22556153
2 changed files with 9 additions and 2 deletions

View File

@@ -70,8 +70,7 @@ jobs:
# Work around runtime failures on the GH Actions runner # Work around runtime failures on the GH Actions runner
dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
.\make.ps1 check .\make.ps1 check
dotnet build OpenRA.Test\OpenRA.Test.csproj -c Debug --nologo -p:TargetPlatform=win-x64 .\make.ps1 tests
dotnet test bin\OpenRA.Test.dll --test-adapter-path:.
- name: Check Mods - name: Check Mods
run: | run: |

View File

@@ -110,6 +110,13 @@ function Test-Command
InvokeCommand "$utilityPath ra --check-yaml" InvokeCommand "$utilityPath ra --check-yaml"
} }
function Tests-Command
{
Write-Host "Running unit tests..." -ForegroundColor Cyan
dotnet build OpenRA.Test\OpenRA.Test.csproj -c Debug --nologo -p:TargetPlatform=win-x64
dotnet test bin\OpenRA.Test.dll --test-adapter-path:.
}
function Check-Command function Check-Command
{ {
Write-Host "Compiling in Debug configuration..." -ForegroundColor Cyan Write-Host "Compiling in Debug configuration..." -ForegroundColor Cyan
@@ -253,6 +260,7 @@ switch ($execute)
{"version", "v" -contains $_} { Version-Command } {"version", "v" -contains $_} { Version-Command }
{"clean", "c" -contains $_} { Clean-Command } {"clean", "c" -contains $_} { Clean-Command }
{"test", "t" -contains $_} { Test-Command } {"test", "t" -contains $_} { Test-Command }
{"tests", "ut" -contains $_} { Tests-Command }
{"check", "ck" -contains $_} { Check-Command } {"check", "ck" -contains $_} { Check-Command }
{"check-scripts", "cs" -contains $_} { Check-Scripts-Command } {"check-scripts", "cs" -contains $_} { Check-Scripts-Command }
Default { Write-Host ("Invalid command '{0}'" -f $command) } Default { Write-Host ("Invalid command '{0}'" -f $command) }