forked from code-cracker/code-cracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runTestsVB.ps1
30 lines (25 loc) · 1.01 KB
/
runTestsVB.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
param([String]$testClass)
$testDllDirPath = "$PSScriptRoot\test\VisualBasic\CodeCracker.Test\bin\Debug\"
$testDllFileName = "CodeCracker.Test.VisualBasic.dll"
$testDllFullFileName = "$testDllDirPath$testDllFileName"
$xunitConsole = "$PSScriptRoot\packages\xunit.runner.console.2.1.0\tools\xunit.console.x86.exe"
if (!(gcm nodemon -ErrorAction Ignore)) {
Write-Host -ForegroundColor DarkRed 'Nodemon not found, install it with npm: `npm i -g nodemon`'
return
}
if ($testClass -eq "now"){
. $xunitConsole "$testDllFullFileName"
return
}
Write-Host "Watching $testDllDirPath"
If ($testClass) {
If ($testClass.StartsWith("CodeCracker.Test") -eq $false) {
$testClass = "CodeCracker.Test.VisualBasic.$testClass"
}
Write-Host "Only for $testClass"
}
If ($testClass) {
nodemon --watch $testDllFullFileName --exec "`"$xunitConsole`" `"$testDllFullFileName`" -class $testClass || exit 1"
} Else {
nodemon --watch $testDllFullFileName --exec "`"$xunitConsole`" `"$testDllFullFileName`" || exit 1"
}