Skip to content

Commit

Permalink
Add time attribute in Junit Reporter #275
Browse files Browse the repository at this point in the history
- Using suites as dictionary;
- Using start, end to print time attributes in testsuite and testcase.
  • Loading branch information
hugosenari committed Nov 28, 2014
1 parent fc3a271 commit 39f493d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions share/junit.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
<testsuite name="<%= suite.name %>"
errors="<%= suite.errorCount %>"
failures="<%= suite.failureCount %>"
tests="<%= suite.tests %>">
<% for (var j=0; j < suite.testcases.length; j++) { %>
<% var testcase=suites[i].testcases[j]; %>
<testcase name="<%= testcase.name %>">
tests="<%= suite.tests %>"
time="<%= (suite.end - suite.start)/1000 %>"
>
<% for (var testCaseName in suite.testcases) { %>
<% var testcase=suite.testcases[testCaseName]; %>
<testcase name="<%= testcase.name %>" time="<%= (testcase.end - testcase.start)/1000 %>">
<% if (testcase.failure) { %>
<failure message="<%= testcase.failure.message %>">
<% if (testcase.failure.backtrace) { %><%= testcase.failure.backtrace %><% } %>
Expand Down

0 comments on commit 39f493d

Please sign in to comment.