Merge pull request #2797 from avsej/pedantic-tester
Introduce pedantic mode for tester
This commit is contained in:
commit
475520f692
2 changed files with 9 additions and 2 deletions
4
koch.nim
4
koch.nim
|
|
@ -333,8 +333,10 @@ proc tests(args: string) =
|
||||||
# taint mode test :-)
|
# taint mode test :-)
|
||||||
exec "nim cc --taintMode:on tests/testament/tester"
|
exec "nim cc --taintMode:on tests/testament/tester"
|
||||||
let tester = quoteShell(getCurrentDir() / "tests/testament/tester".exe)
|
let tester = quoteShell(getCurrentDir() / "tests/testament/tester".exe)
|
||||||
exec tester & " " & (args|"all")
|
let success = tryExec tester & " " & (args|"all")
|
||||||
exec tester & " html"
|
exec tester & " html"
|
||||||
|
if not success:
|
||||||
|
quit("tests failed", QuitFailure)
|
||||||
|
|
||||||
proc temp(args: string) =
|
proc temp(args: string) =
|
||||||
var output = "compiler" / "nim".exe
|
var output = "compiler" / "nim".exe
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ Arguments:
|
||||||
Options:
|
Options:
|
||||||
--print also print results to the console
|
--print also print results to the console
|
||||||
--failing only show failing/ignored tests
|
--failing only show failing/ignored tests
|
||||||
|
--pedantic return non-zero status code if there are failures
|
||||||
""" % resultsFile
|
""" % resultsFile
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -310,12 +311,14 @@ proc main() =
|
||||||
backend.open()
|
backend.open()
|
||||||
var optPrintResults = false
|
var optPrintResults = false
|
||||||
var optFailing = false
|
var optFailing = false
|
||||||
|
var optPedantic = false
|
||||||
var p = initOptParser()
|
var p = initOptParser()
|
||||||
p.next()
|
p.next()
|
||||||
while p.kind == cmdLongoption:
|
while p.kind == cmdLongoption:
|
||||||
case p.key.string.normalize
|
case p.key.string.normalize
|
||||||
of "print", "verbose": optPrintResults = true
|
of "print", "verbose": optPrintResults = true
|
||||||
of "failing": optFailing = true
|
of "failing": optFailing = true
|
||||||
|
of "pedantic": optPedantic = true
|
||||||
else: quit Usage
|
else: quit Usage
|
||||||
p.next()
|
p.next()
|
||||||
if p.kind != cmdArgument: quit Usage
|
if p.kind != cmdArgument: quit Usage
|
||||||
|
|
@ -348,8 +351,10 @@ proc main() =
|
||||||
if action == "html": openDefaultBrowser(resultsFile)
|
if action == "html": openDefaultBrowser(resultsFile)
|
||||||
else: echo r, r.data
|
else: echo r, r.data
|
||||||
backend.close()
|
backend.close()
|
||||||
|
if optPedantic:
|
||||||
|
var failed = r.total - r.passed - r.skipped
|
||||||
|
if failed > 0 : quit(QuitFailure)
|
||||||
|
|
||||||
if paramCount() == 0:
|
if paramCount() == 0:
|
||||||
quit Usage
|
quit Usage
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue