forked from Radarr/Radarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.ps1
40 lines (32 loc) · 993 Bytes
/
test.ps1
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
# 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