Commit cdc832d2 authored by Markus Kauppila's avatar Markus Kauppila

Cleaned the XSL style a bit.

parent b5253257
......@@ -736,5 +736,5 @@ main(int argc, char *argv[])
RunEnded(totalTestPassCount + totalTestfailureCount, suiteCounter,
totalTestPassCount, totalTestfailureCount, time(0), totalRunTime);
return 0;
return (totalTestfailureCount ? 1 : 0);
}
......@@ -12,95 +12,88 @@
<script type="text/javascript">
var hideTests = '[Hide tests]';
var showTests = '[Show tests]';
var hideAsserts = '[Hide Assert Summary]';
var showAsserts = '[Show Assert Summary]';
var hideAllTests = '[Hide All Tests]';
var showAllTests = '[Show All Tests]';
var hideEverything = '[Hide Everything]';
var showEverything = '[Show Everything]';
var animationSpeed = 'fast';
$(document).ready(function() {
$("span.show-tests").click(function() {
var content = $(this).html();
var id = $(this).attr('uid');
var searchString = "div.tests[uid="+id+"]";
if(content == '[Hide tests]') {
$(searchString).hide("fast");
$(this).text('[Show tests]');
if(content == hideTests) {
$(searchString).hide(animationSpeed);
$(this).text(showTests);
} else {
$(searchString).show("fast");
$(this).text('[Hide tests]');
$(searchString).show(animationSpeed);
$(this).text(hideTests);
}
});
$("span.show-asserts").click(function() {
var content = $(this).html();
var id = $(this).attr('uid');
console.log("assert uid" + id);
var searchString = "div.asserts[uid="+id+"]";
if(content == '[Hide Assert Summary]') {
console.log("hide now");
$(searchString).hide("fast");
$(this).text('[Show Assert Summary]');
if(content == hideAsserts) {
$(searchString).hide(animationSpeed);
$(this).text(showAsserts);
} else {
console.log("show now");
$(searchString).show("fast");
$(this).text('[Hide Assert Summary]');
$(searchString).show(animationSpeed);
$(this).text(hideAsserts);
}
});
$("span.show-all-tests").click(function() {
var content = $(this).html();
var searchString = "div.tests";
if(content == '[Hide All Tests]') {
console.log("hide now");
$(searchString).hide("fast");
$(this).text('[Show All Tests]');
if(content == hideAllTests) {
$(searchString).hide(animationSpeed);
$(this).text(showAllTests);
/* handle the individual '[show tests]' switcher */
$("span.show-tests[uid]").text('[Show tests]');
$("span.show-tests[uid]").text(showTests);
} else {
console.log("show now");
$(searchString).show("fast");
$(this).text('[Hide All Tests]');
$(searchString).show(animationSpeed);
$(this).text(hideAllTests);
/* handle the individual '[show tests]' switcher */
$("span.show-tests[uid]").text('[Hide tests]');
$("span.show-tests[uid]").text(hideTests);
}
});
$("span.show-everything").click(function() {
var content = $(this).html();
var searchString = "div.tests";
if(content == '[Hide Everything]') {
console.log("hide now");
$("div.tests").hide("fast");
$("div.asserts").hide("fast");
$(this).text('[Show Everything]');
if(content == hideEverything) {
$("div.tests").hide(animationSpeed);
$("div.asserts").hide(animationSpeed);
$(this).text(showEverything);
/* handle the individual switchers */
$("span.show-tests[uid]").text('[Show tests]');
$("span.show-asserts[uid]").text('[Show Assert Summary]');
$("span.show-tests[uid]").text(showTests);
$("span.show-asserts[uid]").text(showAsserts);
} else {
console.log("show now");
$("div.tests").show("fast");
$("div.asserts").show("fast");
$(this).text('[Hide Everything]');
$("div.tests").show(animationSpeed);
$("div.asserts").show(animationSpeed);
$(this).text(hideEverything);
/* handle the individual switchers */
$("span.show-tests[uid]").text('[Hide tests]');
$("span.show-asserts[uid]").text('[Hide Assert Summary]');
$("span.show-tests[uid]").text(hideTests);
$("span.show-asserts[uid]").text(hideAsserts);
}
});
......@@ -108,8 +101,13 @@ $(document).ready(function() {
$("div.tests").hide();
$("div.asserts").hide();
$("div.test[result='passed']").addClass('passedTest');
$("div.test[result='failed']").addClass('failedTest');
/* Color the tests based on the result */
$("div.test[result='passed']").addClass('passed');
$("div.test[result='failed']").addClass('failed');
/* Color the asserts based on the result */
$("div.assert[result='pass']").addClass('passed');
$("div.assert[result='failure']").addClass('failed');
});
</script>
......@@ -146,17 +144,14 @@ div, h1 {
cursor: pointer;
}
.passedTest {
.passed {
background-color: #64AA2B;
}
.failedTest {
.failed {
background-color: #FF6E40;
}
.statistics {
}
</style>
</head>
......@@ -174,7 +169,7 @@ div, h1 {
<span class="title">Statistics:</span><br/>
<div class="statistics">
<span>Executed </span> <xsl:value-of select="testlog/numSuites"/> test suites. <br/>
<span>Tests in total: </span> <xsl:value-of select="testlog/numTests"/> (passed: <xsl:value-of select="testlog/numPassedTests"/> , failed: <xsl:value-of select="testlog/numFailedTests"/>)
<span>Tests in total: </span> <xsl:value-of select="testlog/numTests"/> (passed: <xsl:value-of select="testlog/numPassedTests"/>, failed: <xsl:value-of select="testlog/numFailedTests"/>)
</div>
</div>
......@@ -209,7 +204,10 @@ div, h1 {
<span class="switch show-asserts" uid="{generate-id(assertSummary)}">[Show Assert Summary]</span><br/>
<div class="asserts" uid="{generate-id(assertSummary)}">
<xsl:for-each select="assert">
<div id="assert">
<div class="assert">
<xsl:attribute name="result">
<xsl:value-of select="result"/>
</xsl:attribute>
Assert name: <xsl:value-of select="name"/> <br/>
Result: <xsl:value-of select="result"/> <br/>
Message <xsl:value-of select="message"/> <br/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment