-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.ps1
29 lines (28 loc) · 907 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
Write-Host "Start Aspose.Cells Cloud SDK for Java"
$StartTime = Get-Date
[string[]]$lines = mvn.cmd test
$result = $false
$passed = 0
$total =0
$failed = 0
$skipped =0
foreach($line in $lines)
{
if($line -match "Results :")
{
$result = $true
}
if($result -and $line -match "Tests run: (\d+), Failures: (\d+), Errors: (\d+), Skipped: (\d+)")
{
$total=$matches[1]
$passed=$matches[2]
$failed=$matches[3]
$skipped=$matches[4]
break
}
}
$failed = $failed + $passed
$passed = $total -$failed -$skipped
$EndTime = Get-Date
$timespan ="{0:N2}" -f (New-TimeSpan $StartTime $EndTime).TotalSeconds
Write-Host "Spent ${timespan}s on finishing test. Result : Total ${total}, Passed ${passed} , Failed ${failed} ,Skipped ${skipped} ."