Skip to content

Commit

Permalink
Merge pull request web-platform-tests#78 from w3c/jgraham/harness_status
Browse files Browse the repository at this point in the history
Make harness status more obvious in default output.
  • Loading branch information
jgraham committed Jun 6, 2014
2 parents afed47d + ec1013c commit 2e9c0e9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
15 changes: 15 additions & 0 deletions testharness.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,18 @@ table#results span.actual {
white-space:pre;
}

span.ok {
color:green;
}

tr.error {
color:red;
}

span.timeout {
color:red;
}

span.ok, span.timeout, span.error {
font-variant:small-caps;
}
23 changes: 11 additions & 12 deletions testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -1429,22 +1429,20 @@ policies and contribution forms [3].
["h2", {}, "Summary"],
function()
{
if (harness_status.status === harness_status.OK) {
return null;
}

var status = status_text_harness[harness_status.status];
var rv = [["p", {"class":status_class(status)}]];
var rv = [["section", {},
["p", {},
"Harness status: ",
["span", {"class":status_class(status)},
status
],
]
]];

if (harness_status.status === harness_status.ERROR) {
rv[0].push("Harness encountered an error:");
rv.push(["pre", {}, harness_status.message]);
} else if (harness_status.status === harness_status.TIMEOUT) {
rv[0].push("Harness timed out.");
} else {
rv[0].push("Harness got an unexpected status.");
rv[0].push(["pre", {}, harness_status.message]);
}

return rv;
},
["p", {}, "Found ${num_tests} tests"],
Expand All @@ -1462,7 +1460,8 @@ policies and contribution forms [3].
i++;
}
return rv;
}];
},
];

log.appendChild(render(summary_template, {num_tests:tests.length}, output_document));

Expand Down

0 comments on commit 2e9c0e9

Please sign in to comment.