new tester produces json output
This commit is contained in:
parent
38697234f6
commit
d29aa4c5ac
7 changed files with 30 additions and 721 deletions
|
|
@ -159,3 +159,22 @@ proc generateHtml*(filename: string, commit: int) =
|
|||
outfile.write(HtmlEnd)
|
||||
close(db)
|
||||
close(outfile)
|
||||
|
||||
proc generateJson*(filename: string, commit: int) =
|
||||
const selRow = """select count(*),
|
||||
sum(result = 'reSuccess'),
|
||||
sum(result = 'reIgnored')
|
||||
from TestResult
|
||||
where [commit] = ? and machine = ?
|
||||
order by category"""
|
||||
var db = open(connection="testament.db", user="testament", password="",
|
||||
database="testament")
|
||||
let lastCommit = db.getCommit(commit)
|
||||
|
||||
var outfile = open(filename, fmWrite)
|
||||
|
||||
let data = db.getRow(sql(selRow), lastCommit, $backend.getMachine(db))
|
||||
|
||||
outfile.writeln("""{"total": $#, "passed": $#, "skipped": $#}""" % data)
|
||||
close(db)
|
||||
close(outfile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue