1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-22 07:52:34 +00:00

New: Run tests through powershell. (#1903)

This commit is contained in:
Mike 2017-08-10 20:11:12 +02:00 committed by Leonardo Galli
parent 17387c8b50
commit 7f3ab36c4f

40
test.ps1 Normal file
View file

@ -0,0 +1,40 @@
# Available types:
# - Unit
# - Integration
# - Automation
param([string]$type = "Unit")
$where = "cat != ManualTest && cat != LINUX"
$testDir = "."
$testPattern = "*Test.dll"
$nunit = "nunit3-console.exe"
$nunitCommand = $nunit
if (!(Get-Command $nunit -ErrorAction SilentlyContinue)) {
Write-Error "nunit3-console.exe was not found in your PATH, please install https://github.com/nunit/nunit-console/releases."
exit
}
switch ($type) {
"unit" {
$where = $where + " && cat != IntegrationTest && cat != AutomationTest"
}
"integration" {
$where = $where + " && cat == IntegrationTest"
}
"automation" {
$where = $where + " && cat == AutomationTest"
}
Default {
Write-Error "Invalid test type specified."
exit
}
}
$assemblies = (Get-ChildItem -Path $testDir -Filter $testPattern -Recurse -File -Name) -join " "
$command = $nunitCommand + " --where '" + $where + "' " + $assemblies
Invoke-Expression $command