forked from Uberi/Yunit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.ps1
48 lines (40 loc) · 1.13 KB
/
runner.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
# CLI: .\runner.ps1 -Monitor $false
param (
[string]$path = $(Get-Location),
[string]$file = "*Tests.ahk",
[bool]$monitor = $true,
# [string]$autohotkeyExe = "Autohotkey" # assumes it's in $env:PATH
[string]$autohotkeyExe = 'C:\Program Files\AutoHotkey\AutoHotkey.exe'
)
# Example output
# *****************
# ** Start Yunit **
# *****************
# Running tests in .\Yunit\doc\*Tests.ahk
#
# File: doc\Example.ahk
# PASS: SuiteName.Test1
# FAIL: SuiteName.Test2
# Message: Oops!
# Expected: value
# But got: diffValue
#
# on line 58 of .\Yunit\doc\ExampleTests.ahk
#
. "$PSScriptRoot\runner\run-watcher.ps1"
. "$PSScriptRoot\runner\run-tests.ps1"
. "$PSScriptRoot\runner\TestResult.ps1"
. "$PSScriptRoot\runner\Writer.ps1"
$config = @{
autohotkeyPath=$autohotkeyExe; monitorPath=$path; match=$file;
failColor='Magenta'; errorColor='Red'; passColor='Green';
infoColor='White'; titleColor='Blue';
indent=' ';
}
# Execute tests
$write = [Writer]::new($config)
$write.title("Start Yunit")
Run-AllTests $config.monitorPath $config.match
if ($monitor) {
Run-Watcher $config.monitorPath $config.match
}