Added test duration output (#6619)

This commit is contained in:
Dmitry Atamanov
2017-12-15 21:13:57 +03:00
committed by Andreas Rumpf
parent 7c3e00d469
commit 1de3938008

View File

@@ -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: