You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/test.ps1
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,9 @@ Assert (Test-Path $casesDir) "Test cases directory not found at: $casesDir"
59
59
60
60
Write-Host'Running tests...'
61
61
62
+
# Record the wall-clock time when the first test case is invoked.
63
+
$testStart=Get-Date
64
+
62
65
$failures=@()
63
66
$total=0
64
67
@@ -96,6 +99,9 @@ foreach ($case in $failingCases) {
96
99
}
97
100
}
98
101
102
+
$testEnd=Get-Date
103
+
$elapsed=$testEnd-$testStart
104
+
$elapsedSeconds='{0:N3}'-f$elapsed.TotalSeconds
99
105
Write-Host''
100
106
if ($failures.Count-gt0) {
101
107
Write-Host'FAILURES:'-ForegroundColor Red
@@ -104,9 +110,9 @@ if ($failures.Count -gt 0) {
104
110
if ($f.Output) { Write-Host$f.Output-ForegroundColor Red}
105
111
}
106
112
Write-Host''
107
-
Write-Host"Completed with $($total-$failures.Count)/$($total) tests passing, $($failures.Count)/$($total) tests failing."-ForegroundColor Red
113
+
Write-Host"Ran $total tests in $elapsedSeconds seconds, with $($total-$failures.Count)/$($total) tests passing, $($failures.Count)/$($total) tests failing."-ForegroundColor Red
108
114
exit1
109
115
} else {
110
-
Write-Host"Completed with $($total)/$($total) tests passing, 0/$($total) tests failing."-ForegroundColor Green
116
+
Write-Host"Ran $total tests in $elapsedSeconds seconds, with $($total)/$($total) tests passing, 0/$($total) tests failing."-ForegroundColor Green
0 commit comments