Outputting additional information into the JUnit XML

Since it is available and seems to be desired by the JUnit spec [ http://stackoverflow.com/questions/4922867/junit-xml-format-specification-that-hudson-supports ]
This commit is contained in:
Kelvin Luck 2013-01-08 10:38:29 +00:00
parent 8e85e593bd
commit ef8f191c46
3 changed files with 37 additions and 35 deletions

View File

@ -42,16 +42,17 @@
function(expectation)
{
if (!expectation.passed()) {
failureMessages.push((failureMessages.length + 1) + ': ' + expectation.message);
failureMessages.push(expectation.message);
}
}
);
}
return {
assertions: spec.results().items_.length,
className: getNestedSuiteName(spec.suite),
name: spec.description,
time: spec.duration / 1000,
failureMessage: failureMessages.join(' ')
failureMessages: failureMessages
};
}
)

View File

@ -225,16 +225,17 @@
function(expectation)
{
if (!expectation.passed()) {
failureMessages.push((failureMessages.length + 1) + ': ' + expectation.message);
failureMessages.push(expectation.message);
}
}
);
}
return {
assertions: spec.results().items_.length,
className: getNestedSuiteName(spec.suite),
name: spec.description,
time: spec.duration / 1000,
failureMessage: failureMessages.join(' ')
failureMessages: failureMessages
};
}
)

View File

@ -3,10 +3,10 @@
<% testsuites.forEach(function(testsuite) { %>
<testsuite name="<%- testsuite.name %>" errors="<%= testsuite.errors %>" tests="<%= testsuite.tests %>" failures="<%= testsuite.failures %>" time="<%= testsuite.time %>" timestamp="<%= testsuite.timestamp %>">
<% testsuite.testcases.forEach(function(testcase) { %>
<testcase classname="<%- testcase.classname %>" name="<%- testcase.name %>" time="<%= testcase.time %>">
<% if (testcase.failureMessage) { %>
<failure><%= testcase.failureMessage %></failure>
<% } %>
<testcase assertions="<%= testcase.assertions %>" classname="<%- testcase.classname %>" name="<%- testcase.name %>" time="<%= testcase.time %>">
<% testcase.failureMessages.forEach(function(message) { %>
<failure><%= message %></failure>
<% }) %>
</testcase>
<% }) %>
</testsuite>