forked from microsoft/hcsshim
/
Test-Functional.ps1
62 lines (50 loc) · 1.13 KB
/
Test-Functional.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
58
59
60
61
62
# ex: .\scripts\Test-Functional.ps1 -Action Bench -Count 2 -BenchTime "2x"
[CmdletBinding()]
param (
[ValidateSet('Test', 'Bench', 'List')]
[alias('a')]
[string]
$Action = 'Bench',
[string]
$Note = '',
[string]
$OutDirectory = '.\test\results',
# test parameters
[int]
$Count = 1,
[string]
$BenchTime = '5s',
[string]
$Timeout = '10m',
[alias('tv')]
[switch]
$TestVerbose,
[string]
$Run = '',
[string]
$Feature = ''
)
Import-Module ( Join-Path $PSScriptRoot Testing.psm1 ) -Force
$date = Get-Date
$testcmd, $out = New-TestCommand `
-Action $Action `
-Path .\bin\test\functional.exe `
-Name functional `
-OutDirectory $OutDirectory `
-Date $date `
-Note $Note `
-TestVerbose:$TestVerbose `
-Count $Count `
-BenchTime $BenchTime `
-Timeout $Timeout `
-Run $Run `
-Feature $Feature `
-Verbose:$Verbose
Invoke-TestCommand `
-TestCmd $testcmd `
-OutputFile $out `
-OutputCmd (&{ if ( $Action -eq 'Bench' ) { 'benchstat' } }) `
-Preamble `
-Date $Date `
-Note $Note `
-Verbose:$Verbose