testament: make valgrind optional (#21238)
Add a simple switch to enable/disable valgrind support. On by default
This commit is contained in:
parent
8be46f3d16
commit
e4e947232b
2 changed files with 12 additions and 1 deletions
|
|
@ -50,6 +50,7 @@ Options
|
|||
--colors:on|off Turn messages coloring on|off.
|
||||
--backendLogging:on|off Disable or enable backend logging. By default turned on.
|
||||
--megatest:on|off Enable or disable megatest. Default is on.
|
||||
--valgrind:on|off Enable or disable valgrind support. Default is on.
|
||||
--skipFrom:file Read tests to skip from `file` - one test per line, # comments ignored
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ var backendLogging = true
|
|||
var simulate = false
|
||||
var optVerbose = false
|
||||
var useMegatest = true
|
||||
var valgrindEnabled = true
|
||||
|
||||
proc verboseCmd(cmd: string) =
|
||||
if optVerbose:
|
||||
|
|
@ -60,6 +61,7 @@ Options:
|
|||
--colors:on|off Turn messages coloring on|off.
|
||||
--backendLogging:on|off Disable or enable backend logging. By default turned on.
|
||||
--megatest:on|off Enable or disable megatest. Default is on.
|
||||
--valgrind:on|off Enable or disable valgrind support. Default is on.
|
||||
--skipFrom:file Read tests to skip from `file` - one test per line, # comments ignored
|
||||
|
||||
On Azure Pipelines, testament will also publish test results via Azure Pipelines' Test Management API
|
||||
|
|
@ -487,7 +489,7 @@ proc testSpecHelper(r: var TResults, test: var TTest, expected: TSpec,
|
|||
args = @["--unhandled-rejections=strict", exeFile] & args
|
||||
else:
|
||||
exeCmd = exeFile.dup(normalizeExe)
|
||||
if expected.useValgrind != disabled:
|
||||
if valgrindEnabled and expected.useValgrind != disabled:
|
||||
var valgrindOptions = @["--error-exitcode=1"]
|
||||
if expected.useValgrind != leaking:
|
||||
valgrindOptions.add "--leak-check=yes"
|
||||
|
|
@ -664,6 +666,14 @@ proc main() =
|
|||
useMegatest = false
|
||||
else:
|
||||
quit Usage
|
||||
of "valgrind":
|
||||
case p.val:
|
||||
of "on":
|
||||
valgrindEnabled = true
|
||||
of "off":
|
||||
valgrindEnabled = false
|
||||
else:
|
||||
quit Usage
|
||||
of "backendlogging":
|
||||
case p.val:
|
||||
of "on":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue