testament html generation improvements; merged #6667 manually
This commit is contained in:
parent
18508cdcc3
commit
765116d547
2 changed files with 217 additions and 256 deletions
|
|
@ -9,54 +9,33 @@
|
||||||
|
|
||||||
## HTML generator for the tester.
|
## HTML generator for the tester.
|
||||||
|
|
||||||
import cgi, backend, strutils, json, os
|
import cgi, backend, strutils, json, os, tables, times
|
||||||
|
|
||||||
import "testamenthtml.templ"
|
import "testamenthtml.templ"
|
||||||
|
|
||||||
proc generateTestRunTabListItemPartial(outfile: File, testRunRow: JsonNode, firstRow = false) =
|
proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode) =
|
||||||
let
|
let
|
||||||
# The first tab gets the bootstrap class for a selected tab
|
trId = htmlQuote(testResultRow["category"].str & "_" & testResultRow["name"].str).
|
||||||
firstTabActiveClass = if firstRow: "active"
|
multiReplace({".": "_", " ": "_", ":": "_"})
|
||||||
else: ""
|
|
||||||
commitId = htmlQuote testRunRow["commit"].str
|
|
||||||
hash = htmlQuote(testRunRow["commit"].str)
|
|
||||||
branch = htmlQuote(testRunRow["branch"].str)
|
|
||||||
machineId = htmlQuote testRunRow["machine"].str
|
|
||||||
machineName = htmlQuote(testRunRow["machine"].str)
|
|
||||||
|
|
||||||
outfile.generateHtmlTabListItem(
|
|
||||||
firstTabActiveClass,
|
|
||||||
commitId,
|
|
||||||
machineId,
|
|
||||||
branch,
|
|
||||||
hash,
|
|
||||||
machineName
|
|
||||||
)
|
|
||||||
|
|
||||||
proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode, onlyFailing = false) =
|
|
||||||
let
|
|
||||||
trId = htmlQuote(testResultRow["category"].str & "_" & testResultRow["name"].str)
|
|
||||||
name = testResultRow["name"].str.htmlQuote()
|
name = testResultRow["name"].str.htmlQuote()
|
||||||
category = testResultRow["category"].str.htmlQuote()
|
category = testResultRow["category"].str.htmlQuote()
|
||||||
target = testResultRow["target"].str.htmlQuote()
|
target = testResultRow["target"].str.htmlQuote()
|
||||||
action = testResultRow["action"].str.htmlQuote()
|
action = testResultRow["action"].str.htmlQuote()
|
||||||
result = htmlQuote testResultRow["result"].str
|
result = htmlQuote testResultRow["result"].str
|
||||||
expected = htmlQuote testResultRow["expected"].str
|
expected = testResultRow["expected"].str
|
||||||
gotten = htmlQuote testResultRow["given"].str
|
gotten = testResultRow["given"].str
|
||||||
timestamp = "unknown"
|
timestamp = "unknown"
|
||||||
var panelCtxClass, textCtxClass, bgCtxClass, resultSign, resultDescription: string
|
var
|
||||||
|
panelCtxClass, textCtxClass, bgCtxClass: string
|
||||||
|
resultSign, resultDescription: string
|
||||||
case result
|
case result
|
||||||
of "reSuccess":
|
of "reSuccess":
|
||||||
if onlyFailing:
|
|
||||||
return
|
|
||||||
panelCtxClass = "success"
|
panelCtxClass = "success"
|
||||||
textCtxClass = "success"
|
textCtxClass = "success"
|
||||||
bgCtxClass = "success"
|
bgCtxClass = "success"
|
||||||
resultSign = "ok"
|
resultSign = "ok"
|
||||||
resultDescription = "PASS"
|
resultDescription = "PASS"
|
||||||
of "reIgnored":
|
of "reIgnored":
|
||||||
if onlyFailing:
|
|
||||||
return
|
|
||||||
panelCtxClass = "info"
|
panelCtxClass = "info"
|
||||||
textCtxClass = "info"
|
textCtxClass = "info"
|
||||||
bgCtxClass = "info"
|
bgCtxClass = "info"
|
||||||
|
|
@ -71,9 +50,7 @@ proc generateTestResultPanelPartial(outfile: File, testResultRow: JsonNode, only
|
||||||
|
|
||||||
outfile.generateHtmlTestresultPanelBegin(
|
outfile.generateHtmlTestresultPanelBegin(
|
||||||
trId, name, target, category, action, resultDescription,
|
trId, name, target, category, action, resultDescription,
|
||||||
timestamp,
|
timestamp, result, resultSign, panelCtxClass, textCtxClass, bgCtxClass
|
||||||
result, resultSign,
|
|
||||||
panelCtxClass, textCtxClass, bgCtxClass
|
|
||||||
)
|
)
|
||||||
if expected.isNilOrWhitespace() and gotten.isNilOrWhitespace():
|
if expected.isNilOrWhitespace() and gotten.isNilOrWhitespace():
|
||||||
outfile.generateHtmlTestresultOutputNone()
|
outfile.generateHtmlTestresultOutputNone()
|
||||||
|
|
@ -90,7 +67,7 @@ type
|
||||||
totalCount, successCount, ignoredCount, failedCount: int
|
totalCount, successCount, ignoredCount, failedCount: int
|
||||||
successPercentage, ignoredPercentage, failedPercentage: BiggestFloat
|
successPercentage, ignoredPercentage, failedPercentage: BiggestFloat
|
||||||
|
|
||||||
proc allTestResults(): AllTests =
|
proc allTestResults(onlyFailing = false): AllTests =
|
||||||
result.data = newJArray()
|
result.data = newJArray()
|
||||||
for file in os.walkFiles("testresults/*.json"):
|
for file in os.walkFiles("testresults/*.json"):
|
||||||
let data = parseFile(file)
|
let data = parseFile(file)
|
||||||
|
|
@ -98,69 +75,74 @@ proc allTestResults(): AllTests =
|
||||||
echo "[ERROR] ignoring json file that is not an array: ", file
|
echo "[ERROR] ignoring json file that is not an array: ", file
|
||||||
else:
|
else:
|
||||||
for elem in data:
|
for elem in data:
|
||||||
result.data.add elem
|
|
||||||
let state = elem["result"].str
|
let state = elem["result"].str
|
||||||
|
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("reIgnored"): inc result.ignoredCount
|
||||||
|
if not onlyFailing or not(state.contains("reSuccess")):
|
||||||
|
result.data.add elem
|
||||||
|
result.successPercentage = 100 *
|
||||||
|
(result.successCount.toBiggestFloat / result.totalCount.toBiggestFloat)
|
||||||
|
result.ignoredPercentage = 100 *
|
||||||
|
(result.ignoredCount.toBiggestFloat / result.totalCount.toBiggestFloat)
|
||||||
|
result.failedCount = result.totalCount -
|
||||||
|
result.successCount - result.ignoredCount
|
||||||
|
result.failedPercentage = 100 *
|
||||||
|
(result.failedCount.toBiggestFloat / result.totalCount.toBiggestFloat)
|
||||||
|
|
||||||
result.totalCount = result.data.len
|
proc generateTestResultsPanelGroupPartial(outfile: File, allResults: JsonNode) =
|
||||||
result.successPercentage = 100 * (result.successCount.toBiggestFloat() / result.totalCount.toBiggestFloat())
|
|
||||||
result.ignoredPercentage = 100 * (result.ignoredCount.toBiggestFloat() / result.totalCount.toBiggestFloat())
|
|
||||||
result.failedCount = result.totalCount - result.successCount - result.ignoredCount
|
|
||||||
result.failedPercentage = 100 * (result.failedCount.toBiggestFloat() / result.totalCount.toBiggestFloat())
|
|
||||||
|
|
||||||
|
|
||||||
proc generateTestResultsPanelGroupPartial(outfile: File, allResults: JsonNode, onlyFailing = false) =
|
|
||||||
for testresultRow in allResults:
|
for testresultRow in allResults:
|
||||||
generateTestResultPanelPartial(outfile, testresultRow, onlyFailing)
|
generateTestResultPanelPartial(outfile, testresultRow)
|
||||||
|
|
||||||
proc generateTestRunTabContentPartial(outfile: File, allResults: AllTests, testRunRow: JsonNode, onlyFailing = false, firstRow = false) =
|
proc generateAllTestsContent(outfile: File, allResults: AllTests,
|
||||||
|
onlyFailing = false) =
|
||||||
|
if allResults.data.len < 1: return # Nothing to do if there is no data.
|
||||||
|
# Only results from one test run means that test run environment info is the
|
||||||
|
# same for all tests
|
||||||
let
|
let
|
||||||
# The first tab gets the bootstrap classes for a selected and displaying tab content
|
firstRow = allResults.data[0]
|
||||||
firstTabActiveClass = if firstRow: " in active"
|
commit = htmlQuote firstRow["commit"].str
|
||||||
else: ""
|
branch = htmlQuote firstRow["branch"].str
|
||||||
commitId = htmlQuote testRunRow["commit"].str
|
machine = htmlQuote firstRow["machine"].str
|
||||||
hash = htmlQuote(testRunRow["commit"].str)
|
|
||||||
branch = htmlQuote(testRunRow["branch"].str)
|
|
||||||
machineId = htmlQuote testRunRow["machine"].str
|
|
||||||
machineName = htmlQuote(testRunRow["machine"].str)
|
|
||||||
os = htmlQuote("unknown_os")
|
|
||||||
cpu = htmlQuote("unknown_cpu")
|
|
||||||
|
|
||||||
outfile.generateHtmlTabPageBegin(
|
outfile.generateHtmlAllTestsBegin(
|
||||||
firstTabActiveClass, commitId,
|
machine, commit, branch,
|
||||||
machineId, branch, hash, machineName, os, cpu,
|
|
||||||
allResults.totalCount,
|
allResults.totalCount,
|
||||||
allResults.successCount, formatBiggestFloat(allResults.successPercentage, ffDecimal, 2) & "%",
|
allResults.successCount,
|
||||||
allResults.ignoredCount, formatBiggestFloat(allResults.ignoredPercentage, ffDecimal, 2) & "%",
|
formatBiggestFloat(allResults.successPercentage, ffDecimal, 2) & "%",
|
||||||
allResults.failedCount, formatBiggestFloat(allResults.failedPercentage, ffDecimal, 2) & "%"
|
allResults.ignoredCount,
|
||||||
|
formatBiggestFloat(allResults.ignoredPercentage, ffDecimal, 2) & "%",
|
||||||
|
allResults.failedCount,
|
||||||
|
formatBiggestFloat(allResults.failedPercentage, ffDecimal, 2) & "%",
|
||||||
|
onlyFailing
|
||||||
)
|
)
|
||||||
generateTestResultsPanelGroupPartial(outfile, allResults.data, onlyFailing)
|
generateTestResultsPanelGroupPartial(outfile, allResults.data)
|
||||||
outfile.generateHtmlTabPageEnd()
|
outfile.generateHtmlAllTestsEnd()
|
||||||
|
|
||||||
proc generateTestRunsHtmlPartial(outfile: File, allResults: AllTests, onlyFailing = false) =
|
|
||||||
# Iterating the results twice, get entire result set in one go
|
|
||||||
outfile.generateHtmlTabListBegin()
|
|
||||||
if allResults.data.len > 0:
|
|
||||||
generateTestRunTabListItemPartial(outfile, allResults.data[0], true)
|
|
||||||
outfile.generateHtmlTabListEnd()
|
|
||||||
|
|
||||||
outfile.generateHtmlTabContentsBegin()
|
|
||||||
var firstRow = true
|
|
||||||
for testRunRow in allResults.data:
|
|
||||||
generateTestRunTabContentPartial(outfile, allResults, testRunRow, onlyFailing, firstRow)
|
|
||||||
if firstRow:
|
|
||||||
firstRow = false
|
|
||||||
outfile.generateHtmlTabContentsEnd()
|
|
||||||
|
|
||||||
proc generateHtml*(filename: string, onlyFailing: bool) =
|
proc generateHtml*(filename: string, onlyFailing: bool) =
|
||||||
|
let
|
||||||
|
currentTime = getTime().getLocalTime()
|
||||||
|
timestring = htmlQuote format(currentTime, "yyyy-MM-dd HH:mm:ss 'UTC'zzz")
|
||||||
var outfile = open(filename, fmWrite)
|
var outfile = open(filename, fmWrite)
|
||||||
|
|
||||||
outfile.generateHtmlBegin()
|
outfile.generateHtmlBegin()
|
||||||
|
|
||||||
generateTestRunsHtmlPartial(outfile, allTestResults(), onlyFailing)
|
generateAllTestsContent(outfile, allTestResults(onlyFailing), onlyFailing)
|
||||||
|
|
||||||
outfile.generateHtmlEnd()
|
outfile.generateHtmlEnd(timestring)
|
||||||
|
|
||||||
outfile.flushFile()
|
outfile.flushFile()
|
||||||
close(outfile)
|
close(outfile)
|
||||||
|
|
||||||
|
proc dumpJsonTestResults*(prettyPrint, onlyFailing: bool) =
|
||||||
|
var
|
||||||
|
outfile = stdout
|
||||||
|
jsonString: string
|
||||||
|
|
||||||
|
let results = allTestResults(onlyFailing)
|
||||||
|
if prettyPrint:
|
||||||
|
jsonString = results.data.pretty()
|
||||||
|
else:
|
||||||
|
jsonString = $ results.data
|
||||||
|
|
||||||
|
outfile.writeLine(jsonString)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {number} index
|
* @param {number} index
|
||||||
* @param {Element[]} elemArray
|
* @param {Element[]} elemArray
|
||||||
* @param {executeForElement} executeOnItem
|
* @param {executeForElement} executeOnItem
|
||||||
|
|
@ -69,17 +69,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tabId The id of the tabpanel div to search.
|
|
||||||
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
||||||
* @param {executeForElement} executeOnEachPanel
|
* @param {executeForElement} executeOnEachPanel
|
||||||
*/
|
*/
|
||||||
function wholePanelAll(tabId, category, executeOnEachPanel) {
|
function wholePanelAll(category, executeOnEachPanel) {
|
||||||
var selector = "div.panel";
|
var selector = "div.panel";
|
||||||
if (typeof category === "string" && category) {
|
if (typeof category === "string" && category) {
|
||||||
selector += "-" + category;
|
selector += "-" + category;
|
||||||
}
|
}
|
||||||
|
|
||||||
var jqPanels = $(selector, $("#" + tabId));
|
var jqPanels = $(selector);
|
||||||
/** @type {Element[]} */
|
/** @type {Element[]} */
|
||||||
var elemArray = jqPanels.toArray();
|
var elemArray = jqPanels.toArray();
|
||||||
|
|
||||||
|
|
@ -87,17 +86,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tabId The id of the tabpanel div to search.
|
|
||||||
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
||||||
* @param {executeForElement} executeOnEachPanel
|
* @param {executeForElement} executeOnEachPanel
|
||||||
*/
|
*/
|
||||||
function panelBodyAll(tabId, category, executeOnEachPanelBody) {
|
function panelBodyAll(category, executeOnEachPanelBody) {
|
||||||
var selector = "div.panel";
|
var selector = "div.panel";
|
||||||
if (typeof category === "string" && category) {
|
if (typeof category === "string" && category) {
|
||||||
selector += "-" + category;
|
selector += "-" + category;
|
||||||
}
|
}
|
||||||
|
|
||||||
var jqPanels = $(selector, $("#" + tabId));
|
var jqPanels = $(selector);
|
||||||
|
|
||||||
var jqPanelBodies = $("div.panel-body", jqPanels);
|
var jqPanelBodies = $("div.panel-body", jqPanels);
|
||||||
/** @type {Element[]} */
|
/** @type {Element[]} */
|
||||||
|
|
@ -107,35 +105,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tabId The id of the tabpanel div to search.
|
|
||||||
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
||||||
*/
|
*/
|
||||||
function showAll(tabId, category) {
|
function showAll(category) {
|
||||||
wholePanelAll(tabId, category, executeShowOnElement);
|
wholePanelAll(category, executeShowOnElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tabId The id of the tabpanel div to search.
|
|
||||||
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
||||||
*/
|
*/
|
||||||
function hideAll(tabId, category) {
|
function hideAll(category) {
|
||||||
wholePanelAll(tabId, category, executeHideOnElement);
|
wholePanelAll(category, executeHideOnElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tabId The id of the tabpanel div to search.
|
|
||||||
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
||||||
*/
|
*/
|
||||||
function expandAll(tabId, category) {
|
function expandAll(category) {
|
||||||
panelBodyAll(tabId, category, executeExpandOnElement);
|
panelBodyAll(category, executeExpandOnElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} tabId The id of the tabpanel div to search.
|
|
||||||
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
* @param {string} [category] Optional bootstrap panel context class (danger, warning, info, success)
|
||||||
*/
|
*/
|
||||||
function collapseAll(tabId, category) {
|
function collapseAll(category) {
|
||||||
panelBodyAll(tabId, category, executeCollapseOnElement);
|
panelBodyAll(category, executeCollapseOnElement);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
@ -143,176 +137,161 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>Testament Test Results <small>Nim Tester</small></h1>
|
<h1>Testament Test Results <small>Nim Tester</small></h1>
|
||||||
#end proc
|
#end proc
|
||||||
#proc generateHtmlTabListBegin*(outfile: File) =
|
#proc generateHtmlAllTestsBegin*(outfile: File, machine, commit, branch: string,
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
# totalCount: BiggestInt,
|
||||||
#end proc
|
|
||||||
#proc generateHtmlTabListItem*(outfile: File, firstTabActiveClass, commitId,
|
|
||||||
# machineId, branch, hash, machineName: string) =
|
|
||||||
<li role="presentation" class="%firstTabActiveClass">
|
|
||||||
<a href="#tab-commit-%commitId-machine-%machineId" aria-controls="tab-commit-%commitId-machine-%machineId" role="tab" data-toggle="tab">
|
|
||||||
%branch#%hash@%machineName
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
#end proc
|
|
||||||
#proc generateHtmlTabListEnd*(outfile: File) =
|
|
||||||
</ul>
|
|
||||||
#end proc
|
|
||||||
#proc generateHtmlTabContentsBegin*(outfile: File) =
|
|
||||||
<div class="tab-content">
|
|
||||||
#end proc
|
|
||||||
#proc generateHtmlTabPageBegin*(outfile: File, firstTabActiveClass, commitId,
|
|
||||||
# machineId, branch, hash, machineName, os, cpu: string, totalCount: BiggestInt,
|
|
||||||
# successCount: BiggestInt, successPercentage: string,
|
# successCount: BiggestInt, successPercentage: string,
|
||||||
# ignoredCount: BiggestInt, ignoredPercentage: string,
|
# ignoredCount: BiggestInt, ignoredPercentage: string,
|
||||||
# failedCount: BiggestInt, failedPercentage: string) =
|
# failedCount: BiggestInt, failedPercentage: string, onlyFailing = false) =
|
||||||
<div id="tab-commit-%commitId-machine-%machineId" class="tab-pane fade%firstTabActiveClass" role="tabpanel">
|
<dl class="dl-horizontal">
|
||||||
<h2>%branch#%hash@%machineName</h2>
|
<dt>Hostname</dt>
|
||||||
<dl class="dl-horizontal">
|
<dd>%machine</dd>
|
||||||
<dt>Branch</dt>
|
<dt>Git Commit</dt>
|
||||||
<dd>%branch</dd>
|
<dd><code>%commit</code></dd>
|
||||||
<dt>Commit Hash</dt>
|
<dt title="Git Branch reference">Branch ref.</dt>
|
||||||
<dd><code>%hash</code></dd>
|
<dd>%branch</dd>
|
||||||
<dt>Machine Name</dt>
|
</dl>
|
||||||
<dd>%machineName</dd>
|
<dl class="dl-horizontal">
|
||||||
<dt>OS</dt>
|
<dt>All Tests</dt>
|
||||||
<dd>%os</dd>
|
<dd>
|
||||||
<dt title="CPU Architecture">CPU</dt>
|
<span class="glyphicon glyphicon-th-list"></span>
|
||||||
<dd>%cpu</dd>
|
%totalCount
|
||||||
<dt>All Tests</dt>
|
</dd>
|
||||||
<dd>
|
<dt>Successful Tests</dt>
|
||||||
<span class="glyphicon glyphicon-th-list"></span>
|
<dd>
|
||||||
%totalCount
|
<span class="glyphicon glyphicon-ok-sign"></span>
|
||||||
</dd>
|
%successCount (%successPercentage)
|
||||||
<dt>Successful Tests</dt>
|
</dd>
|
||||||
<dd>
|
<dt>Skipped Tests</dt>
|
||||||
<span class="glyphicon glyphicon-ok-sign"></span>
|
<dd>
|
||||||
%successCount (%successPercentage)
|
<span class="glyphicon glyphicon-question-sign"></span>
|
||||||
</dd>
|
%ignoredCount (%ignoredPercentage)
|
||||||
<dt>Skipped Tests</dt>
|
</dd>
|
||||||
<dd>
|
<dt>Failed Tests</dt>
|
||||||
<span class="glyphicon glyphicon-question-sign"></span>
|
<dd>
|
||||||
%ignoredCount (%ignoredPercentage)
|
<span class="glyphicon glyphicon-exclamation-sign"></span>
|
||||||
</dd>
|
%failedCount (%failedPercentage)
|
||||||
<dt>Failed Tests</dt>
|
</dd>
|
||||||
<dd>
|
</dl>
|
||||||
<span class="glyphicon glyphicon-exclamation-sign"></span>
|
<div class="table-responsive">
|
||||||
%failedCount (%failedPercentage)
|
<table class="table table-condensed">
|
||||||
</dd>
|
# if not onlyFailing:
|
||||||
</dl>
|
<tr>
|
||||||
<div class="table-responsive">
|
<th class="text-right" style="vertical-align:middle">All Tests</th>
|
||||||
<table class="table table-condensed">
|
<td>
|
||||||
<tr>
|
<div class="btn-group">
|
||||||
<th class="text-right" style="vertical-align:middle">All Tests</th>
|
<button class="btn btn-default" type="button" onclick="showAll();">Show All</button>
|
||||||
<td>
|
<button class="btn btn-default" type="button" onclick="hideAll();">Hide All</button>
|
||||||
<div class="btn-group">
|
<button class="btn btn-default" type="button" onclick="expandAll();">Expand All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="showAll('tab-commit-%commitId-machine-%machineId');">Show All</button>
|
<button class="btn btn-default" type="button" onclick="collapseAll();">Collapse All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="hideAll('tab-commit-%commitId-machine-%machineId');">Hide All</button>
|
</div>
|
||||||
<button class="btn btn-default" type="button" onclick="expandAll('tab-commit-%commitId-machine-%machineId');">Expand All</button>
|
</td>
|
||||||
<button class="btn btn-default" type="button" onclick="collapseAll('tab-commit-%commitId-machine-%machineId');">Collapse All</button>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
</td>
|
<th class="text-right" style="vertical-align:middle">Successful Tests</th>
|
||||||
</tr>
|
<td>
|
||||||
<tr>
|
<div class="btn-group">
|
||||||
<th class="text-right" style="vertical-align:middle">Successful Tests</th>
|
<button class="btn btn-default" type="button" onclick="showAll('success');">Show All</button>
|
||||||
<td>
|
<button class="btn btn-default" type="button" onclick="hideAll('success');">Hide All</button>
|
||||||
<div class="btn-group">
|
<button class="btn btn-default" type="button" onclick="expandAll('success');">Expand All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="showAll('tab-commit-%commitId-machine-%machineId', 'success');">Show All</button>
|
<button class="btn btn-default" type="button" onclick="collapseAll('success');">Collapse All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="hideAll('tab-commit-%commitId-machine-%machineId', 'success');">Hide All</button>
|
</div>
|
||||||
<button class="btn btn-default" type="button" onclick="expandAll('tab-commit-%commitId-machine-%machineId', 'success');">Expand All</button>
|
</td>
|
||||||
<button class="btn btn-default" type="button" onclick="collapseAll('tab-commit-%commitId-machine-%machineId', 'success');">Collapse All</button>
|
</tr>
|
||||||
</div>
|
# end if
|
||||||
</td>
|
<tr>
|
||||||
</tr>
|
<th class="text-right" style="vertical-align:middle">Skipped Tests</th>
|
||||||
<tr>
|
<td>
|
||||||
<th class="text-right" style="vertical-align:middle">Skipped Tests</th>
|
<div class="btn-group">
|
||||||
<td>
|
<button class="btn btn-default" type="button" onclick="showAll('info');">Show All</button>
|
||||||
<div class="btn-group">
|
<button class="btn btn-default" type="button" onclick="hideAll('info');">Hide All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="showAll('tab-commit-%commitId-machine-%machineId', 'info');">Show All</button>
|
<button class="btn btn-default" type="button" onclick="expandAll('info');">Expand All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="hideAll('tab-commit-%commitId-machine-%machineId', 'info');">Hide All</button>
|
<button class="btn btn-default" type="button" onclick="collapseAll('info');">Collapse All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="expandAll('tab-commit-%commitId-machine-%machineId', 'info');">Expand All</button>
|
</div>
|
||||||
<button class="btn btn-default" type="button" onclick="collapseAll('tab-commit-%commitId-machine-%machineId', 'info');">Collapse All</button>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</td>
|
<tr>
|
||||||
</tr>
|
<th class="text-right" style="vertical-align:middle">Failed Tests</th>
|
||||||
<tr>
|
<td>
|
||||||
<th class="text-right" style="vertical-align:middle">Failed Tests</th>
|
<div class="btn-group">
|
||||||
<td>
|
<button class="btn btn-default" type="button" onclick="showAll('danger');">Show All</button>
|
||||||
<div class="btn-group">
|
<button class="btn btn-default" type="button" onclick="hideAll('danger');">Hide All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="showAll('tab-commit-%commitId-machine-%machineId', 'danger');">Show All</button>
|
<button class="btn btn-default" type="button" onclick="expandAll('danger');">Expand All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="hideAll('tab-commit-%commitId-machine-%machineId', 'danger');">Hide All</button>
|
<button class="btn btn-default" type="button" onclick="collapseAll('danger');">Collapse All</button>
|
||||||
<button class="btn btn-default" type="button" onclick="expandAll('tab-commit-%commitId-machine-%machineId', 'danger');">Expand All</button>
|
</div>
|
||||||
<button class="btn btn-default" type="button" onclick="collapseAll('tab-commit-%commitId-machine-%machineId', 'danger');">Collapse All</button>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</td>
|
</table>
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
<div class="panel-group">
|
||||||
</div>
|
|
||||||
<div class="panel-group">
|
|
||||||
#end proc
|
#end proc
|
||||||
#proc generateHtmlTestresultPanelBegin*(outfile: File, trId, name, target, category,
|
#proc generateHtmlTestresultPanelBegin*(outfile: File, trId, name, target, category,
|
||||||
# action, resultDescription, timestamp, result, resultSign,
|
# action, resultDescription, timestamp, result, resultSign,
|
||||||
# panelCtxClass, textCtxClass, bgCtxClass: string) =
|
# panelCtxClass, textCtxClass, bgCtxClass: string) =
|
||||||
<div id="panel-testResult-%trId" class="panel panel-%panelCtxClass">
|
<div id="panel-testResult-%trId" class="panel panel-%panelCtxClass">
|
||||||
<div class="panel-heading" style="cursor:pointer" data-toggle="collapse" data-target="#panel-body-testResult-%trId" aria-controls="panel-body-testResult-%trId" aria-expanded="false">
|
<div class="panel-heading" style="cursor:pointer" data-toggle="collapse" data-target="#panel-body-testResult-%trId" aria-controls="panel-body-testResult-%trId" aria-expanded="false">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h4 class="col-xs-3 col-sm-1 panel-title">
|
<h4 class="col-xs-3 col-sm-1 panel-title">
|
||||||
<span class="glyphicon glyphicon-%resultSign-sign"></span>
|
<span class="glyphicon glyphicon-%resultSign-sign"></span>
|
||||||
<strong>%resultDescription</strong>
|
<strong>%resultDescription</strong>
|
||||||
</h4>
|
</h4>
|
||||||
<h4 class="col-xs-1 panel-title"><span class="badge">%target</span></h4>
|
<h4 class="col-xs-1 panel-title"><span class="badge">%target</span></h4>
|
||||||
<h4 class="col-xs-5 col-sm-7 panel-title" title="%name"><code class="text-%textCtxClass">%name</code></h4>
|
<h4 class="col-xs-5 col-sm-7 panel-title" title="%name"><code class="text-%textCtxClass">%name</code></h4>
|
||||||
<h4 class="col-xs-3 col-sm-3 panel-title text-right"><span class="badge">%category</span></h4>
|
<h4 class="col-xs-3 col-sm-3 panel-title text-right"><span class="badge">%category</span></h4>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="panel-body-testResult-%trId" class="panel-body collapse bg-%bgCtxClass">
|
<div id="panel-body-testResult-%trId" class="panel-body collapse bg-%bgCtxClass">
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>Name</dt>
|
<dt>Name</dt>
|
||||||
<dd><code class="text-%textCtxClass">%name</code></dd>
|
<dd><code class="text-%textCtxClass">%name</code></dd>
|
||||||
<dt>Category</dt>
|
<dt>Category</dt>
|
||||||
<dd><span class="badge">%category</span></dd>
|
<dd><span class="badge">%category</span></dd>
|
||||||
<dt>Timestamp</dt>
|
<dt>Timestamp</dt>
|
||||||
<dd>%timestamp</dd>
|
<dd>%timestamp</dd>
|
||||||
<dt>Nim Action</dt>
|
<dt>Nim Action</dt>
|
||||||
<dd><code class="text-%textCtxClass">%action</code></dd>
|
<dd><code class="text-%textCtxClass">%action</code></dd>
|
||||||
<dt>Nim Backend Target</dt>
|
<dt>Nim Backend Target</dt>
|
||||||
<dd><span class="badge">%target</span></dd>
|
<dd><span class="badge">%target</span></dd>
|
||||||
<dt>Code</dt>
|
<dt>Code</dt>
|
||||||
<dd><code class="text-%textCtxClass">%result</code></dd>
|
<dd><code class="text-%textCtxClass">%result</code></dd>
|
||||||
</dl>
|
</dl>
|
||||||
#end proc
|
#end proc
|
||||||
#proc generateHtmlTestresultOutputDetails*(outfile: File, expected, gotten: string) =
|
#proc generateHtmlTestresultOutputDetails*(outfile: File, expected, gotten: string) =
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-condensed">
|
<table class="table table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Expected</th>
|
<th>Expected</th>
|
||||||
<th>Actual</th>
|
<th>Actual</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre>%expected</pre></td>
|
<td><pre>%expected</pre></td>
|
||||||
<td><pre>%gotten</pre></td>
|
<td><pre>%gotten</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
#end proc
|
|
||||||
#proc generateHtmlTestresultOutputNone*(outfile: File) =
|
|
||||||
<p class="sr-only">No output details</p>
|
|
||||||
#end proc
|
|
||||||
#proc generateHtmlTestresultPanelEnd*(outfile: File) =
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
#end proc
|
#end proc
|
||||||
#proc generateHtmlTabPageEnd*(outfile: File) =
|
#proc generateHtmlTestresultOutputNone*(outfile: File) =
|
||||||
|
<p class="sr-only">No output details</p>
|
||||||
|
#end proc
|
||||||
|
#proc generateHtmlTestresultPanelEnd*(outfile: File) =
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
#end proc
|
#end proc
|
||||||
#proc generateHtmlTabContentsEnd*(outfile: File) =
|
#proc generateHtmlAllTestsEnd*(outfile: File) =
|
||||||
</div>
|
</div>
|
||||||
#end proc
|
#end proc
|
||||||
#proc generateHtmlEnd*(outfile: File) =
|
#proc generateHtmlEnd*(outfile: File, timestamp: string) =
|
||||||
|
<hr />
|
||||||
|
<footer>
|
||||||
|
<p>
|
||||||
|
Report generated by: <code>testament</code> – Nim Tester
|
||||||
|
<br />
|
||||||
|
Made with Nim. Generated on: %timestamp
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue