Skip to content

Commit

Permalink
Merge pull request #17 from hillbrad/hillbrad/runner-notrun
Browse files Browse the repository at this point in the history
update runner to display and report count of tests NOTRUN
  • Loading branch information
sideshowbarker committed Jul 8, 2015
2 parents 84c2a90 + 3929c49 commit 04dea96
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions runner/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ <h4>Progress
<th>Failed
<th>Timeouts
<th>Errors
<th>Not Run</th>
</tr>
</thead>
<tbody>
Expand All @@ -129,6 +130,7 @@ <h4>Progress
<td class='FAIL'>0
<td class='TIMEOUT'>0
<td class='ERROR'>0
<td class='NOTRUN'>0
</tr>
</tbody>
</table>
Expand Down
4 changes: 4 additions & 0 deletions runner/runner.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ td.TIMEOUT {
color: #f6bb42;
}

td.NOTRUN {
color: #00c;
}

td.ERROR {
color: #da4453;
font-weight: bold;
Expand Down
14 changes: 11 additions & 3 deletions runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ VisualOutput.prototype = {
this.result_count = {"PASS":0,
"FAIL":0,
"ERROR":0,
"TIMEOUT":0};
"TIMEOUT":0,
"NOTRUN":0};
for (var p in this.result_count) {
if (this.result_count.hasOwnProperty(p)) {
this.elem.querySelector("td." + p).textContent = 0;
Expand Down Expand Up @@ -183,12 +184,19 @@ VisualOutput.prototype = {
var subtest_pass_count = subtests.reduce(function(prev, current) {
return (current.status === "PASS") ? prev + 1 : prev;
}, 0);

var subtest_notrun_count = subtests.reduce(function(prev, current) {
return (current.status === "NOTRUN") ? prev +1 : prev;
}, 0);

var subtests_count = subtests.length;

var test_status;
if (subtest_pass_count === subtests_count &&
(status == "OK" || status == "PASS")) {
test_status = "PASS";
} else if (subtest_notrun_count == subtests_count) {
test_status = "NOTRUN";
} else if (subtests_count > 0 && status === "OK") {
test_status = "FAIL";
} else {
Expand Down Expand Up @@ -225,7 +233,7 @@ VisualOutput.prototype = {
}
}

var status_arr = ["PASS", "FAIL", "ERROR", "TIMEOUT"];
var status_arr = ["PASS", "FAIL", "ERROR", "TIMEOUT", "NOTRUN"];
for (var i = 0; i < status_arr.length; i++) {
this.elem.querySelector("td." + status_arr[i]).textContent = this.result_count[status_arr[i]];
}
Expand Down Expand Up @@ -707,7 +715,7 @@ function setup() {
}

window.completion_callback = function(tests, status) {
var harness_status_map = {0:"OK", 1:"ERROR", 2:"TIMEOUT"};
var harness_status_map = {0:"OK", 1:"ERROR", 2:"TIMEOUT", 3:"NOTRUN"};
var subtest_status_map = {0:"PASS", 1:"FAIL", 2:"TIMEOUT", 3:"NOTRUN"};

// this ugly hack is because IE really insists on holding on to the objects it creates in
Expand Down

0 comments on commit 04dea96

Please sign in to comment.