Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixes for NO coverage support
  • Loading branch information
zzo committed Nov 21, 2011
1 parent 3e16c13 commit 28e01cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions backend/nodejute/jute/jute_docs/jute.js
Expand Up @@ -179,8 +179,8 @@ YUI().add('jute', function(Y) {
test = data.availableTests[i]; test = data.availableTests[i];
content += '<tr>'; content += '<tr>';
content += '<td>' + test.test_url + '</td>'; content += '<td>' + test.test_url + '</td>';
content += '<td align="center"><input name="test" class="no_cov_cbox" type="checkbox" value="' + test.test_url + '" />&nbsp;<a href="/' + data.config.testDirWeb + test.test_url + '?_one_shot=1">Run</a></td>'; content += '<td align="center"><input name="test" class="no_cov_cbox" type="checkbox" value="' + test.test_url + '?do_coverage=0" />&nbsp;<a href="/' + data.config.testDirWeb + test.test_url + '?do_coverage=0&_one_shot=1">Run</a></td>';
content += '<td align="center"><input name="test" class="cov_cbox" type="checkbox" value="' + test.test_url + '?do_coverage=1" /><a href="/' + data.config.testDirWeb + test.test_url + '?_one_shot=1&do_coverage=1">Run</a></td>'; content += '<td align="center"><input name="test" class="cov_cbox" type="checkbox" value="' + test.test_url + '" /><a href="/' + data.config.testDirWeb + test.test_url + '?_one_shot=1">Run</a></td>';
content += '</tr>'; content += '</tr>';
} }
content += '</table>'; content += '</table>';
Expand Down
17 changes: 5 additions & 12 deletions backend/nodejute/jute/server.js
Expand Up @@ -117,18 +117,11 @@ Create: function(hub) {


try { fs.statSync(path); } catch(e) { res.writeHeader(404); res.end('Cannot find: ' + path ); return; } // 404 this bad boy try { fs.statSync(path); } catch(e) { res.writeHeader(404); res.end('Cannot find: ' + path ); return; } // 404 this bad boy


/* // Do coverage for this file IF:
if (req.query._one_shot && path.match(/\.js$/)) { // 1. coverage requested
// A V8 test!! // 2a. referrer header does not exist
exec('JUTE_DEBUG=1 ' + p.join(__dirname, '..', 'jute_v8.js') + ' ' + url + '?do_coverage=' + req.query.do_coverage, function(error, stdout, stderr) { // 2b. OR referrer header ODES NOT HAVE 'do_coverage=0' in its query string
if (error) { if (req.query.coverage && req.headers.referer && !req.headers.referer.match('do_coverage=0')) {
res.end('V8 ERROR: ' + error);
} else {
res.end(stdout);
}
});
} else */
if (req.query.coverage) { // && (!req.headers.referer || req.headers.referer.match('do_coverage=1'))) {
// Coverage this bad boy! // Coverage this bad boy!
var tempFile = p.join('/tmp', p.basename(path)); var tempFile = p.join('/tmp', p.basename(path));
hub.emit(hub.LOG, hub.INFO, "Generating coverage file " + tempFile + " for " + path); hub.emit(hub.LOG, hub.INFO, "Generating coverage file " + tempFile + " for " + path);
Expand Down
2 changes: 1 addition & 1 deletion backend/nodejute/package.json
Expand Up @@ -2,7 +2,7 @@
"name": "jute", "name": "jute",
"description": "Javascript Unit Test Environment", "description": "Javascript Unit Test Environment",
"keywords": ["selenium", "test", "testing", "unit", "tests"], "keywords": ["selenium", "test", "testing", "unit", "tests"],
"version": "0.0.56", "version": "0.0.57",
"author": "Mark Ethan Trostler <mark@zzo.com>", "author": "Mark Ethan Trostler <mark@zzo.com>",
"preferGlobal": true, "preferGlobal": true,
"bin" : { "bin" : {
Expand Down

0 comments on commit 28e01cc

Please sign in to comment.