mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 18:34:43 +00:00
Added test duration output (#6619)
This commit is contained in:
committed by
Andreas Rumpf
parent
7c3e00d469
commit
1de3938008
@@ -158,6 +158,7 @@ proc addResult(r: var TResults, test: TTest, target: TTarget,
|
||||
expected, given: string, success: TResultEnum) =
|
||||
let name = test.name.extractFilename & " " & $target & test.options
|
||||
let duration = epochTime() - test.startTime
|
||||
let durationStr = duration.formatFloat(ffDecimal, precision = 8)
|
||||
backend.writeTestResult(name = name,
|
||||
category = test.cat.string,
|
||||
target = $target,
|
||||
@@ -167,7 +168,7 @@ proc addResult(r: var TResults, test: TTest, target: TTarget,
|
||||
given = given)
|
||||
r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
|
||||
if success == reSuccess:
|
||||
styledEcho fgGreen, "PASS: ", fgCyan, name
|
||||
styledEcho fgGreen, "PASS: ", fgCyan, alignLeft(name, 60), fgBlue, " (", durationStr, " secs)"
|
||||
elif success == reIgnored:
|
||||
styledEcho styleDim, fgYellow, "SKIP: ", styleBright, fgCyan, name
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user