Testament fixes (#10034)
* testament/htmlgen: add support for disabled and joined tests * testament/tester: respect --targets
This commit is contained in:
parent
25d3539da7
commit
8f4befe368
2 changed files with 10 additions and 5 deletions
|
|
@ -35,12 +35,12 @@ proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode) =
|
||||||
bgCtxClass = "success"
|
bgCtxClass = "success"
|
||||||
resultSign = "ok"
|
resultSign = "ok"
|
||||||
resultDescription = "PASS"
|
resultDescription = "PASS"
|
||||||
of "reIgnored":
|
of "reDisabled", "reJoined":
|
||||||
panelCtxClass = "info"
|
panelCtxClass = "info"
|
||||||
textCtxClass = "info"
|
textCtxClass = "info"
|
||||||
bgCtxClass = "info"
|
bgCtxClass = "info"
|
||||||
resultSign = "question"
|
resultSign = "question"
|
||||||
resultDescription = "SKIP"
|
resultDescription = if result != "reJoined": "SKIP" else: "JOINED"
|
||||||
else:
|
else:
|
||||||
panelCtxClass = "danger"
|
panelCtxClass = "danger"
|
||||||
textCtxClass = "danger"
|
textCtxClass = "danger"
|
||||||
|
|
@ -78,7 +78,8 @@ proc allTestResults(onlyFailing = false): AllTests =
|
||||||
let state = elem["result"].str
|
let state = elem["result"].str
|
||||||
inc result.totalCount
|
inc result.totalCount
|
||||||
if state.contains("reSuccess"): inc result.successCount
|
if state.contains("reSuccess"): inc result.successCount
|
||||||
elif state.contains("reIgnored"): inc result.ignoredCount
|
elif state.contains("reDisabled") or state.contains("reJoined"):
|
||||||
|
inc result.ignoredCount
|
||||||
if not onlyFailing or not(state.contains("reSuccess")):
|
if not onlyFailing or not(state.contains("reSuccess")):
|
||||||
result.data.add elem
|
result.data.add elem
|
||||||
result.successPercentage = 100 *
|
result.successPercentage = 100 *
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ let
|
||||||
pegSuccess = peg"'Hint: operation successful'.*"
|
pegSuccess = peg"'Hint: operation successful'.*"
|
||||||
pegOfInterest = pegLineError / pegOtherError
|
pegOfInterest = pegLineError / pegOtherError
|
||||||
|
|
||||||
var targets = {low(TTarget)..high(TTarget)}
|
var gTargets = {low(TTarget)..high(TTarget)}
|
||||||
|
|
||||||
proc normalizeMsg(s: string): string =
|
proc normalizeMsg(s: string): string =
|
||||||
result = newStringOfCap(s.len+1)
|
result = newStringOfCap(s.len+1)
|
||||||
|
|
@ -372,6 +372,10 @@ proc testSpec(r: var TResults, test: TTest, targets: set[TTarget] = {}) =
|
||||||
expected.targets = {targetC}
|
expected.targets = {targetC}
|
||||||
for target in expected.targets:
|
for target in expected.targets:
|
||||||
inc(r.total)
|
inc(r.total)
|
||||||
|
if target notin gTargets:
|
||||||
|
r.addResult(test, target, "", "", reDisabled)
|
||||||
|
inc(r.skipped)
|
||||||
|
continue
|
||||||
case expected.action
|
case expected.action
|
||||||
of actionCompile:
|
of actionCompile:
|
||||||
var given = callCompiler(expected.getCmd, test.name, test.options, target,
|
var given = callCompiler(expected.getCmd, test.name, test.options, target,
|
||||||
|
|
@ -504,7 +508,7 @@ proc main() =
|
||||||
of "pedantic": discard "now always enabled"
|
of "pedantic": discard "now always enabled"
|
||||||
of "targets":
|
of "targets":
|
||||||
targetsStr = p.val.string
|
targetsStr = p.val.string
|
||||||
targets = parseTargets(targetsStr)
|
gTargets = parseTargets(targetsStr)
|
||||||
of "nim":
|
of "nim":
|
||||||
compilerPrefix = addFileExt(p.val.string, ExeExt)
|
compilerPrefix = addFileExt(p.val.string, ExeExt)
|
||||||
of "directory":
|
of "directory":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue