Permalink
Browse files

Display corresponding test name next to each logged entry.

  • Loading branch information...
1 parent af8fff3 commit 0058a06461a873cb3a1d87331c190656a55bb88d @kangax committed Nov 2, 2009
Showing with 7 additions and 3 deletions.
  1. +3 −2 master.css
  2. +4 −1 runner.js
View
@@ -1,6 +1,7 @@
p { margin: 0; padding: 0; }
-#log { font-family: Courier, monospace; background: #fee; border: 1px solid #faa; padding: 0.5em; margin-top: 1em; font-size: 85%; height: 30em; overflow: scroll; }
+#log { font-family: Courier, monospace; background: #fee; border: 1px solid #faa; padding: 0.5em; margin-top: 1em; font-size: 85%; height: 40em; overflow: scroll; }
.description { margin-bottom: 1em; }
#start-trigger { display: block; margin-bottom: 0.5em; }
.label { display: inline-block; width: 8em; }
-#options { position: absolute; top: 1.5em; right: 1em; }
+#options { position: absolute; top: 1.5em; right: 1em; }
+.testname { color: #999; }
View
@@ -1,3 +1,5 @@
+var currentTestName;
+
function $ERROR(message) {
log('ERROR ' + message);
errorCount++;
@@ -14,7 +16,7 @@ function $PRINT(message) {
function log(message) {
var el = document.createElement('p');
- el.innerHTML = message + '<br>';
+ el.innerHTML = message + ' (<span class="testname">' + currentTestName + '</span>)';
document.getElementById('log').appendChild(el);
}
@@ -127,6 +129,7 @@ function startTests(tests) {
var test = tests.shift();
if (!shouldIgnoreTest(test.name)) {
+ currentTestName = test.name;
loadScript(test.path);
testCount++;
}

0 comments on commit 0058a06

Please sign in to comment.