diff options
Diffstat (limited to 'tests/testament/tester.nim')
-rw-r--r-- | tests/testament/tester.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim index 8c8d63da7..4d4bade00 100644 --- a/tests/testament/tester.nim +++ b/tests/testament/tester.nim @@ -12,7 +12,7 @@ import parseutils, strutils, pegs, os, osproc, streams, parsecfg, json, marshal, backend, parseopt, specs, htmlgen, browsers, terminal, - algorithm, compiler/nodejs, re + algorithm, compiler/nodejs, re, times const resultsFile = "testresults.html" @@ -47,6 +47,7 @@ type options: string target: TTarget action: TTestAction + startTime: float # ---------------------------------------------------------------------------- @@ -143,6 +144,7 @@ proc `$`(x: TResults): string = proc addResult(r: var TResults, test: TTest, expected, given: string, success: TResultEnum) = let name = test.name.extractFilename & test.options + let duration = epochTime() - test.startTime backend.writeTestResult(name = name, category = test.cat.string, target = $test.target, @@ -172,7 +174,7 @@ proc addResult(r: var TResults, test: TTest, ("Skipped", "") else: ("Failed", "Expected:\n" & expected & "\n\n" & "Gotten:\n" & given) - discard execProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg], options={poStdErrToStdOut, poUsePath}) + discard execProcess("appveyor", args=["AddTest", test.name & test.options, "-FileName", test.cat.string, "-Outcome", outcome, "-ErrorMessage", msg, "-Duration", $(duration*1000).int], options={poStdErrToStdOut, poUsePath}) proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) = if strip(expected.msg) notin strip(given.msg): @@ -366,7 +368,7 @@ proc makeTest(test, options: string, cat: Category, action = actionCompile, target = targetC, env: string = ""): TTest = # start with 'actionCompile', will be overwritten in the spec: result = TTest(cat: cat, name: test, options: options, - target: target, action: action) + target: target, action: action, startTime: epochTime()) include categories |