-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRunTest.ps1
57 lines (42 loc) · 1.49 KB
/
RunTest.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env powershell -File
# AmiKo|CoMed
param([string]$application)
Write-Host $application
$platform = "x64"
$configuration = "Debug"
# NOTE:
#
# > powershell.exe -ExecutionPolicy Bypass -File .\RunTest.ps1 "AmiKo"
# > powershell.exe -ExecutionPolicy Bypass -File .\RunTest.ps1 "CoMed"
#
if ($application -ne "AmiKo" -and $application -ne "CoMed") {
exit 1
}
taskkill /im 'MSBuild.exe' /f
taskkill /im "$application Desitin.exe" /f
# Linux
wsl rm -f "AmiKoWindows/bin/${configuration}/${application}/${application}\ Desitin.exe"
wsl rm -f "AmiKoWindows/obj/${platform}/${configuration}/${application}\ Desitin.exe"
## Clean All (resources, db and cache etc.)
wsl rm -fr "AmiKoWindows/bin/Debug/$application/*exe*"
wsl rm -fr "AmiKoWindows/obj/**/Debug/*exe"
MSBuild.exe .\AmiKoWindows.Tests\"$application"Desitin.Test.csproj /t:Clean
# Build
MSBuild.exe .\AmiKoWindows.Tests\"$application"Desitin.Test.csproj /t:Build `
/p:Configuration=Debug `
/p:Platform=x64 `
/p:Log=Trace
if ($lastexitcode -ne 0) {
Write-Host "Build faild with status: $lastexitcode"
exit
}
# Run unit tests
$origin = $PWD
$location = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
Push-Location $location
[Environment]::CurrentDirectory = $location
$runner = "$location\Packages\NUnit.ConsoleRunner.3.8.0\tools\nunit3-console.exe"
& "$runner" $location\AmiKoWindows.Tests\bin\Debug\"$application"\"$application"Desitin.Test.dll `
--output TestOutput.log
Pop-Location
[Environment]::CurrentDirectory = $origin