Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
cdc832d2
Commit
cdc832d2
authored
Jun 30, 2011
by
Markus Kauppila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned the XSL style a bit.
parent
b5253257
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
71 deletions
+69
-71
runner.c
test/test-automation/runner.c
+1
-1
style.xsl
test/test-automation/style.xsl
+68
-70
No files found.
test/test-automation/runner.c
View file @
cdc832d2
...
@@ -736,5 +736,5 @@ main(int argc, char *argv[])
...
@@ -736,5 +736,5 @@ main(int argc, char *argv[])
RunEnded
(
totalTestPassCount
+
totalTestfailureCount
,
suiteCounter
,
RunEnded
(
totalTestPassCount
+
totalTestfailureCount
,
suiteCounter
,
totalTestPassCount
,
totalTestfailureCount
,
time
(
0
),
totalRunTime
);
totalTestPassCount
,
totalTestfailureCount
,
time
(
0
),
totalRunTime
);
return
0
;
return
(
totalTestfailureCount
?
1
:
0
)
;
}
}
test/test-automation/style.xsl
View file @
cdc832d2
...
@@ -12,95 +12,88 @@
...
@@ -12,95 +12,88 @@
<script
type=
"text/javascript"
>
<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() {
$(document).ready(function() {
$("span.show-tests").click(function() {
$("span.show-tests").click(function() {
var content = $(this).html();
var content = $(this).html();
var id = $(this).attr('uid');
var id = $(this).attr('uid');
var searchString = "div.tests[uid="+id+"]";
var searchString = "div.tests[uid="+id+"]";
if(content ==
'[Hide tests]'
) {
if(content ==
hideTests
) {
$(searchString).hide(
"fast"
);
$(searchString).hide(
animationSpeed
);
$(this).text(
'[Show tests]'
);
$(this).text(
showTests
);
} else {
} else {
$(searchString).show(
"fast"
);
$(searchString).show(
animationSpeed
);
$(this).text(
'[Hide tests]'
);
$(this).text(
hideTests
);
}
}
});
});
$("span.show-asserts").click(function() {
$("span.show-asserts").click(function() {
var content = $(this).html();
var content = $(this).html();
var id = $(this).attr('uid');
var id = $(this).attr('uid');
console.log("assert uid" + id);
var searchString = "div.asserts[uid="+id+"]";
var searchString = "div.asserts[uid="+id+"]";
if(content == '[Hide Assert Summary]') {
if(content == hideAsserts) {
console.log("hide now");
$(searchString).hide(animationSpeed);
$(this).text(showAsserts);
$(searchString).hide("fast");
$(this).text('[Show Assert Summary]');
} else {
} else {
console.log("show now");
$(searchString).show(animationSpeed);
$(this).text(hideAsserts);
$(searchString).show("fast");
$(this).text('[Hide Assert Summary]');
}
}
});
});
$("span.show-all-tests").click(function() {
$("span.show-all-tests").click(function() {
var content = $(this).html();
var content = $(this).html();
var searchString = "div.tests";
var searchString = "div.tests";
if(content == '[Hide All Tests]') {
if(content == hideAllTests) {
console.log("hide now");
$(searchString).hide(animationSpeed);
$(this).text(showAllTests);
$(searchString).hide("fast");
$(this).text('[Show All Tests]');
/* handle the individual '[show tests]' switcher */
/* handle the individual '[show tests]' switcher */
$("span.show-tests[uid]").text('[Show tests]');
$("span.show-tests[uid]").text(showTests);
} else {
} else {
console.log("show now");
$(searchString).show(animationSpeed);
$(this).text(hideAllTests);
$(searchString).show("fast");
$(this).text('[Hide All Tests]');
/* handle the individual '[show tests]' switcher */
/* handle the individual '[show tests]' switcher */
$("span.show-tests[uid]").text(
'[Hide tests]'
);
$("span.show-tests[uid]").text(
hideTests
);
}
}
});
});
$("span.show-everything").click(function() {
$("span.show-everything").click(function() {
var content = $(this).html();
var content = $(this).html();
var searchString = "div.tests";
var searchString = "div.tests";
if(content == '[Hide Everything]') {
if(content == hideEverything) {
console.log("hide now");
$("div.tests").hide(animationSpeed);
$("div.asserts").hide(animationSpeed);
$("div.tests").hide("fast");
$(this).text(showEverything);
$("div.asserts").hide("fast");
$(this).text('[Show Everything]');
/* handle the individual switchers */
/* handle the individual switchers */
$("span.show-tests[uid]").text(
'[Show tests]'
);
$("span.show-tests[uid]").text(
showTests
);
$("span.show-asserts[uid]").text(
'[Show Assert Summary]'
);
$("span.show-asserts[uid]").text(
showAsserts
);
} else {
} else {
console.log("show now");
$("div.tests").show(animationSpeed);
$("div.asserts").show(animationSpeed);
$("div.tests").show("fast");
$(this).text(hideEverything);
$("div.asserts").show("fast");
$(this).text('[Hide Everything]');
/* handle the individual switchers */
/* handle the individual switchers */
$("span.show-tests[uid]").text('[Hide tests]');
$("span.show-tests[uid]").text(hideTests);
$("span.show-asserts[uid]").text('[Hide Assert Summary]');
$("span.show-asserts[uid]").text(hideAsserts);
}
}
});
});
...
@@ -108,8 +101,13 @@ $(document).ready(function() {
...
@@ -108,8 +101,13 @@ $(document).ready(function() {
$("div.tests").hide();
$("div.tests").hide();
$("div.asserts").hide();
$("div.asserts").hide();
$("div.test[result='passed']").addClass('passedTest');
/* Color the tests based on the result */
$("div.test[result='failed']").addClass('failedTest');
$("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>
</script>
...
@@ -146,17 +144,14 @@ div, h1 {
...
@@ -146,17 +144,14 @@ div, h1 {
cursor: pointer;
cursor: pointer;
}
}
.passed
Test
{
.passed {
background-color: #64AA2B;
background-color: #64AA2B;
}
}
.failed
Test
{
.failed {
background-color: #FF6E40;
background-color: #FF6E40;
}
}
.statistics {
}
</style>
</style>
</head>
</head>
...
@@ -174,7 +169,7 @@ div, h1 {
...
@@ -174,7 +169,7 @@ div, h1 {
<span
class=
"title"
>
Statistics:
</span><br/>
<span
class=
"title"
>
Statistics:
</span><br/>
<div
class=
"statistics"
>
<div
class=
"statistics"
>
<span>
Executed
</span>
<xsl:value-of
select=
"testlog/numSuites"
/>
test suites.
<br/>
<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>
</div>
</div>
...
@@ -208,19 +203,22 @@ div, h1 {
...
@@ -208,19 +203,22 @@ div, h1 {
<span
class=
"switch show-asserts"
uid=
"{generate-id(assertSummary)}"
>
[Show Assert Summary]
</span><br/>
<span
class=
"switch show-asserts"
uid=
"{generate-id(assertSummary)}"
>
[Show Assert Summary]
</span><br/>
<div
class=
"asserts"
uid=
"{generate-id(assertSummary)}"
>
<div
class=
"asserts"
uid=
"{generate-id(assertSummary)}"
>
<xsl:for-each
select=
"assert"
>
<xsl:for-each
select=
"assert"
>
<div
id=
"assert"
>
<div
class=
"assert"
>
Assert name:
<xsl:value-of
select=
"name"
/>
<br/>
<xsl:attribute
name=
"result"
>
Result:
<xsl:value-of
select=
"result"
/>
<br/>
<xsl:value-of
select=
"result"
/>
Message
<xsl:value-of
select=
"message"
/>
<br/>
</xsl:attribute>
Time
<xsl:value-of
select=
"time"
/>
<br/>
Assert name:
<xsl:value-of
select=
"name"
/>
<br/>
Result:
<xsl:value-of
select=
"result"
/>
<br/>
Message
<xsl:value-of
select=
"message"
/>
<br/>
Time
<xsl:value-of
select=
"time"
/>
<br/>
</div>
</xsl:for-each>
AssertSummary:
Assert count:
<xsl:value-of
select=
"assertSummary/assertCount"
/>
<br/>
Asserts Passed
<xsl:value-of
select=
"assertSummary/assertsPassed"
/>
<br/>
Asserts Failed
<xsl:value-of
select=
"assertSummary/assertsFailed"
/>
<br/>
</div>
</div>
</xsl:for-each>
AssertSummary:
Assert count:
<xsl:value-of
select=
"assertSummary/assertCount"
/>
<br/>
Asserts Passed
<xsl:value-of
select=
"assertSummary/assertsPassed"
/>
<br/>
Asserts Failed
<xsl:value-of
select=
"assertSummary/assertsFailed"
/>
<br/>
</div>
</div>
</div>
</xsl:for-each>
</xsl:for-each>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment