allow to disable backend logging
This commit is contained in:
parent
199018ef2e
commit
ca394ebd95
2 changed files with 20 additions and 9 deletions
|
|
@ -15,6 +15,7 @@ import
|
||||||
algorithm, compiler/nodejs, times, sets, md5
|
algorithm, compiler/nodejs, times, sets, md5
|
||||||
|
|
||||||
var useColors = true
|
var useColors = true
|
||||||
|
var backendLogging = true
|
||||||
|
|
||||||
const
|
const
|
||||||
resultsFile = "testresults.html"
|
resultsFile = "testresults.html"
|
||||||
|
|
@ -35,7 +36,8 @@ Options:
|
||||||
--targets:"c c++ js objc" run tests for specified targets (default: all)
|
--targets:"c c++ js objc" run tests for specified targets (default: all)
|
||||||
--nim:path use a particular nim executable (default: compiler/nim)
|
--nim:path use a particular nim executable (default: compiler/nim)
|
||||||
--directory:dir Change to directory dir before reading the tests or doing anything else.
|
--directory:dir Change to directory dir before reading the tests or doing anything else.
|
||||||
--colors:on|off turn messagescoloring on|off
|
--colors:on|off Turn messagescoloring on|off.
|
||||||
|
--backendLogging:on|off Disable or enable backend logging. By default turned on.
|
||||||
""" % resultsFile
|
""" % resultsFile
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -219,13 +221,14 @@ proc addResult(r: var TResults, test: TTest, target: TTarget,
|
||||||
let name = test.name.extractFilename & " " & $target & test.options
|
let name = test.name.extractFilename & " " & $target & test.options
|
||||||
let duration = epochTime() - test.startTime
|
let duration = epochTime() - test.startTime
|
||||||
let durationStr = duration.formatFloat(ffDecimal, precision = 8).align(11)
|
let durationStr = duration.formatFloat(ffDecimal, precision = 8).align(11)
|
||||||
backend.writeTestResult(name = name,
|
if backendLogging:
|
||||||
category = test.cat.string,
|
backend.writeTestResult(name = name,
|
||||||
target = $target,
|
category = test.cat.string,
|
||||||
action = $test.spec.action,
|
target = $target,
|
||||||
result = $success,
|
action = $test.spec.action,
|
||||||
expected = expected,
|
result = $success,
|
||||||
given = given)
|
expected = expected,
|
||||||
|
given = given)
|
||||||
r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
|
r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
|
||||||
if success == reSuccess:
|
if success == reSuccess:
|
||||||
maybeStyledEcho fgGreen, "PASS: ", fgCyan, alignLeft(name, 60), fgBlue, " (", durationStr, " secs)"
|
maybeStyledEcho fgGreen, "PASS: ", fgCyan, alignLeft(name, 60), fgBlue, " (", durationStr, " secs)"
|
||||||
|
|
@ -531,6 +534,14 @@ proc main() =
|
||||||
useColors = false
|
useColors = false
|
||||||
else:
|
else:
|
||||||
quit Usage
|
quit Usage
|
||||||
|
of "backendlogging":
|
||||||
|
case p.val.string:
|
||||||
|
of "on":
|
||||||
|
backendLogging = true
|
||||||
|
of "off":
|
||||||
|
backendLogging = false
|
||||||
|
else:
|
||||||
|
quit Usage
|
||||||
else:
|
else:
|
||||||
quit Usage
|
quit Usage
|
||||||
p.next()
|
p.next()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
discard """
|
discard """
|
||||||
cmd: "testament/tester --directory:testament --colors:off --nim:../compiler/nim category shouldfail"
|
cmd: "testament/tester --directory:testament --colors:off --backendLogging:off --nim:../compiler/nim category shouldfail"
|
||||||
action: compile
|
action: compile
|
||||||
nimout: '''
|
nimout: '''
|
||||||
FAIL: tccodecheck.nim C
|
FAIL: tccodecheck.nim C
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue