fix htmlgen, that I broke
This commit is contained in:
parent
dec863a85a
commit
a22bf14bb6
2 changed files with 8 additions and 10 deletions
|
|
@ -20,14 +20,11 @@ var
|
||||||
thisCommit: CommitId
|
thisCommit: CommitId
|
||||||
thisBranch: string
|
thisBranch: string
|
||||||
|
|
||||||
{.experimental.}
|
|
||||||
proc `()`(cmd: string{lit}): string = cmd.execProcess.string.strip
|
|
||||||
|
|
||||||
proc getMachine*(): MachineId =
|
proc getMachine*(): MachineId =
|
||||||
var name = "hostname"()
|
var name = execProcess("hostname").string.strip
|
||||||
if name.len == 0:
|
if name.len == 0:
|
||||||
name = when defined(posix): getenv"HOSTNAME".string
|
name = when defined(posix): getenv("HOSTNAME").string
|
||||||
else: getenv"COMPUTERNAME".string
|
else: getenv("COMPUTERNAME").string
|
||||||
if name.len == 0:
|
if name.len == 0:
|
||||||
quit "cannot determine the machine name"
|
quit "cannot determine the machine name"
|
||||||
|
|
||||||
|
|
@ -35,8 +32,8 @@ proc getMachine*(): MachineId =
|
||||||
|
|
||||||
proc getCommit(): CommitId =
|
proc getCommit(): CommitId =
|
||||||
const commLen = "commit ".len
|
const commLen = "commit ".len
|
||||||
let hash = "git log -n 1"()[commLen..commLen+10]
|
let hash = execProcess("git log -n 1").string.strip[commLen..commLen+10]
|
||||||
thisBranch = "git symbolic-ref --short HEAD"()
|
thisBranch = execProcess("git symbolic-ref --short HEAD").string.strip
|
||||||
if hash.len == 0 or thisBranch.len == 0: quit "cannot determine git HEAD"
|
if hash.len == 0 or thisBranch.len == 0: quit "cannot determine git HEAD"
|
||||||
result = CommitId(hash)
|
result = CommitId(hash)
|
||||||
|
|
||||||
|
|
@ -45,7 +42,7 @@ var
|
||||||
currentCategory: string
|
currentCategory: string
|
||||||
entries: int
|
entries: int
|
||||||
|
|
||||||
proc writeTestResult*(name, category, target, result, expected, given: string) =
|
proc writeTestResult*(name, category, target, action, result, expected, given: string) =
|
||||||
createDir("testresults")
|
createDir("testresults")
|
||||||
if currentCategory != category:
|
if currentCategory != category:
|
||||||
if currentCategory.len > 0:
|
if currentCategory.len > 0:
|
||||||
|
|
@ -57,7 +54,7 @@ proc writeTestResult*(name, category, target, result, expected, given: string) =
|
||||||
entries = 0
|
entries = 0
|
||||||
|
|
||||||
let jentry = %*{"name": name, "category": category, "target": target,
|
let jentry = %*{"name": name, "category": category, "target": target,
|
||||||
"result": result, "expected": expected, "given": given,
|
"action": action, "result": result, "expected": expected, "given": given,
|
||||||
"machine": thisMachine.string, "commit": thisCommit.string, "branch": thisBranch}
|
"machine": thisMachine.string, "commit": thisCommit.string, "branch": thisBranch}
|
||||||
if entries > 0:
|
if entries > 0:
|
||||||
results.writeLine(",")
|
results.writeLine(",")
|
||||||
|
|
|
||||||
|
|
@ -222,6 +222,7 @@ proc addResult(r: var TResults, test: TTest, target: TTarget,
|
||||||
backend.writeTestResult(name = name,
|
backend.writeTestResult(name = name,
|
||||||
category = test.cat.string,
|
category = test.cat.string,
|
||||||
target = $target,
|
target = $target,
|
||||||
|
action = $test.spec.action,
|
||||||
result = $success,
|
result = $success,
|
||||||
expected = expected,
|
expected = expected,
|
||||||
given = given)
|
given = given)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue