mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
made 'testament all' run in parallel
This commit is contained in:
@@ -70,5 +70,6 @@ proc open*() =
|
||||
thisCommit = getCommit()
|
||||
|
||||
proc close*() =
|
||||
results.writeLine("]")
|
||||
close(results)
|
||||
if currentCategory.len > 0:
|
||||
results.writeLine("]")
|
||||
close(results)
|
||||
|
||||
@@ -99,7 +99,7 @@ proc allTestResults(): AllTests =
|
||||
else:
|
||||
for elem in data:
|
||||
result.data.add elem
|
||||
let state = elem["result"]
|
||||
let state = elem["result"].str
|
||||
if state.contains("reSuccess"): inc result.successCount
|
||||
elif state.contains("reIgnored"): inc result.ignoredCount
|
||||
|
||||
@@ -120,7 +120,7 @@ proc generateTestRunTabContentPartial(outfile: File, allResults: AllTests, testR
|
||||
firstTabActiveClass = if firstRow: " in active"
|
||||
else: ""
|
||||
commitId = htmlQuote testRunRow["commit"].str
|
||||
hash = htmlQuote(testRunRow["hash"].str)
|
||||
hash = htmlQuote(testRunRow["commit"].str)
|
||||
branch = htmlQuote(testRunRow["branch"].str)
|
||||
machineId = htmlQuote testRunRow["machine"].str
|
||||
machineName = htmlQuote(testRunRow["machine"].str)
|
||||
@@ -141,15 +141,12 @@ proc generateTestRunTabContentPartial(outfile: File, allResults: AllTests, testR
|
||||
proc generateTestRunsHtmlPartial(outfile: File, allResults: AllTests, onlyFailing = false) =
|
||||
# Iterating the results twice, get entire result set in one go
|
||||
outfile.generateHtmlTabListBegin()
|
||||
var firstRow = true
|
||||
for testRunRow in allResults.data:
|
||||
generateTestRunTabListItemPartial(outfile, testRunRow, firstRow)
|
||||
if firstRow:
|
||||
firstRow = false
|
||||
if allResults.data.len > 0:
|
||||
generateTestRunTabListItemPartial(outfile, allResults.data[0], true)
|
||||
outfile.generateHtmlTabListEnd()
|
||||
|
||||
outfile.generateHtmlTabContentsBegin()
|
||||
firstRow = true
|
||||
var firstRow = true
|
||||
for testRunRow in allResults.data:
|
||||
generateTestRunTabContentPartial(outfile, allResults, testRunRow, onlyFailing, firstRow)
|
||||
if firstRow:
|
||||
|
||||
@@ -459,13 +459,17 @@ proc main() =
|
||||
case action
|
||||
of "all":
|
||||
let testsDir = "tests" & DirSep
|
||||
let myself = quoteShell(findExe("tests" / "testament" / "tester"))
|
||||
var cmds: seq[string] = @[]
|
||||
let rest = if p.cmdLineRest.string.len > 0: " " & p.cmdLineRest.string else: ""
|
||||
for kind, dir in walkDir(testsDir):
|
||||
assert testsDir.startsWith(testsDir)
|
||||
let cat = dir[testsDir.len .. ^1]
|
||||
if kind == pcDir and cat notin ["testament", "testdata", "nimcache"]:
|
||||
processCategory(r, Category(cat), p.cmdLineRest.string)
|
||||
for a in AdditionalCategories:
|
||||
processCategory(r, Category(a), p.cmdLineRest.string)
|
||||
cmds.add(myself & " cat " & cat & rest)
|
||||
for cat in AdditionalCategories:
|
||||
cmds.add(myself & " cat " & cat & rest)
|
||||
quit osproc.execProcesses(cmds, {poEchoCmd, poStdErrToStdOut, poUsePath, poParentStreams})
|
||||
of "c", "cat", "category":
|
||||
var cat = Category(p.key)
|
||||
p.next
|
||||
|
||||
Reference in New Issue
Block a user