Update argv0 test to verify correct behavior
This commit is contained in:
parent
493a6bb19a
commit
29463cb60c
@ -24,17 +24,24 @@ var assert = require('assert');
|
||||
var spawn = require('child_process').spawn;
|
||||
var common = require('../common');
|
||||
|
||||
console.error('argv=%j', process.argv);
|
||||
console.error('exec=%j', process.execPath);
|
||||
|
||||
if (process.argv[2] !== "child") {
|
||||
var child = spawn('node', [__filename, "child"], {
|
||||
cwd: common.tmpDir,
|
||||
env: util._extend({ PATH: path.dirname(process.execPath) }, process.env)
|
||||
var child = spawn('./node', [__filename, "child"], {
|
||||
cwd: path.dirname(process.execPath)
|
||||
});
|
||||
|
||||
var childArgv0 = '';
|
||||
child.stdout.on('data', function (chunk) {
|
||||
var childErr = '';
|
||||
child.stdout.on('data', function(chunk) {
|
||||
childArgv0 += chunk;
|
||||
});
|
||||
child.stderr.on('data', function(chunk) {
|
||||
childErr += chunk;
|
||||
});
|
||||
child.on('exit', function () {
|
||||
console.error('CHILD: %s', childErr.trim().split('\n').join('\nCHILD: '));
|
||||
assert.equal(childArgv0, process.execPath);
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user