Skip to content

Commit

Permalink
Revert "Add --cov code coverage option"
Browse files Browse the repository at this point in the history
This can be done in user space. EG https://github.com/cloudkick/whiskey

This reverts commit da9b334.
This reverts commit b4ff36a.

Conflicts:

	src/node.cc
  • Loading branch information
ry committed Jun 17, 2011
1 parent 710f8e2 commit 52b517c
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 103 deletions.
16 changes: 0 additions & 16 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,22 +347,6 @@ Module.prototype._compile = function(content, filename) {
// remove shebang
content = content.replace(/^\#\!.*/, '');

// add coverage
if (process.cov) {
var lines = content.split('\n');

if (lines.length > 0) {
lines[0] = '__cov[__filename] = { 0: true}; ' + lines[0];
}

for (var i = 0; i < lines.length; i++) {
lines[i] =
lines[i].replace(/;$/, '; __cov[__filename][' + i + '] = true;');
}

content = lines.join('\n');
}

function require(path) {
return Module._load(path, self);
}
Expand Down
6 changes: 0 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ static char *eval_string = NULL;
static int option_end_index = 0;
static bool use_debug_agent = false;
static bool debug_wait_connect = false;
static bool cov = false;
static int debug_port=5858;
static int max_stack_size = 0;

Expand Down Expand Up @@ -2093,7 +2092,6 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
process->Set(String::NewSymbol("ENV"), ENV);

process->Set(String::NewSymbol("pid"), Integer::New(getpid()));
process->Set(String::NewSymbol("cov"), cov ? True() : False());
process->Set(String::NewSymbol("useUV"), use_uv ? True() : False());

// -e, --eval
Expand Down Expand Up @@ -2237,7 +2235,6 @@ static void PrintHelp() {
" --v8-options print v8 command line options\n"
" --vars print various compiled-in variables\n"
" --max-stack-size=val set max v8 stack size (bytes)\n"
" --cov code coverage; writes node-cov.json \n"
" --use-uv use the libuv backend\n"
"\n"
"Enviromental variables:\n"
Expand All @@ -2261,9 +2258,6 @@ static void ParseArgs(int argc, char **argv) {
if (strstr(arg, "--debug") == arg) {
ParseDebugOpt(arg);
argv[i] = const_cast<char*>("");
} else if (!strcmp(arg, "--cov")) {
cov = true;
argv[i] = const_cast<char*>("");
} else if (!strcmp(arg, "--use-uv")) {
use_uv = true;
argv[i] = const_cast<char*>("");
Expand Down
17 changes: 0 additions & 17 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@
global.GLOBAL = global;
global.root = global;
global.Buffer = NativeModule.require('buffer').Buffer;
if (process.cov) {
global.__cov = {};
}
};

startup.globalTimeouts = function() {
Expand Down Expand Up @@ -364,20 +361,6 @@
var path = NativeModule.require('path');
process.argv[0] = path.join(cwd, process.argv[0]);
}

if (process.cov) {
process.on('exit', function() {
var coverage = JSON.stringify(__cov);
var path = NativeModule.require('path');
var fs = NativeModule.require('fs');
var filename = path.join(cwd, 'node-cov.json');
try {
fs.unlinkSync(filename);
} catch(e) {
}
fs.writeFileSync(filename, coverage);
});
}
};

// Below you find a minimal module system, which is used to load the node
Expand Down
4 changes: 0 additions & 4 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ process.on('exit', function() {
knownGlobals.push(gc);
}

if (global.__cov) {
knownGlobals.push(__cov);
}

if (global.DTRACE_HTTP_SERVER_RESPONSE) {
knownGlobals.push(DTRACE_HTTP_SERVER_RESPONSE);
knownGlobals.push(DTRACE_HTTP_SERVER_REQUEST);
Expand Down
60 changes: 0 additions & 60 deletions tools/covhtml.js

This file was deleted.

0 comments on commit 52b517c

Please sign in to comment.