Skip to content

Commit

Permalink
Add test completion summary to top of test page results. (KhronosGrou…
Browse files Browse the repository at this point in the history
…p#3308)

TEST COMPLETE: 42 PASS, 6 FAIL
  • Loading branch information
kdashg authored Aug 10, 2021
1 parent 331fe2b commit 9ec0bd5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sdk/tests/js/js-test-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,19 @@ _addSpan('<br /><span class="pass">TEST COMPLETE</span>');
if (_jsTestPreVerboseLogging) {
_bufferedLogToConsole('TEST COMPLETE');
}

{
const e_results = document.createElement('div');
let fails_class = 'pass';
if (RESULTS.fail) {
fails_class = 'fail';
}
e_results.classList.add('pass');
e_results.innerHTML = `<p>TEST COMPLETE: ${RESULTS.pass} PASS, ` +
`<span class="${fails_class}">${RESULTS.fail} FAIL</span></p>`;

const e_desc = document.getElementById("description");
e_desc.appendChild(e_results);
}

notifyFinishedToHarness()
10 changes: 10 additions & 0 deletions sdk/tests/js/js-test-pre.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,17 @@ function nonKhronosFrameworkNotifyDone() {
}
}

const RESULTS = {
pass: 0,
fail: 0,
};

function reportTestResultsToHarness(success, msg) {
if (success) {
RESULTS.pass += 1;
} else {
RESULTS.fail += 1;
}
if (window.parent.webglTestHarness) {
window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
}
Expand Down

0 comments on commit 9ec0bd5

Please sign in to comment.