mirror of https://github.com/lukechilds/node.git
Ryan Dahl
15 years ago
2 changed files with 32 additions and 10 deletions
@ -1,11 +1,30 @@ |
|||||
require("../common"); |
require("../common"); |
||||
var spawn = require('child_process').spawn |
spawn = require('child_process').spawn, |
||||
, path = require('path') |
path = require('path'); |
||||
, sub = path.join(fixturesDir, 'exit.js') |
|
||||
, child = spawn(process.argv[0], [sub, 23]) |
|
||||
; |
|
||||
|
|
||||
child.addListener('exit', function(code, signal) { |
exits = 0; |
||||
|
|
||||
|
exitScript = path.join(fixturesDir, 'exit.js') |
||||
|
exitChild = spawn(process.argv[0], [exitScript, 23]); |
||||
|
exitChild.addListener('exit', function(code, signal) { |
||||
assert.strictEqual(code, 23); |
assert.strictEqual(code, 23); |
||||
assert.strictEqual(signal, null); |
assert.strictEqual(signal, null); |
||||
}); |
|
||||
|
exits++; |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
errorScript = path.join(fixturesDir, 'child_process_should_emit_error.js') |
||||
|
errorChild = spawn(process.argv[0], [errorScript]); |
||||
|
errorChild.addListener('exit', function(code, signal) { |
||||
|
assert.ok(code !== 0); |
||||
|
assert.strictEqual(signal, null); |
||||
|
|
||||
|
exits++; |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
process.addListener('exit', function () { |
||||
|
assert.equal(2, exits); |
||||
|
}); |
||||
|
Loading…
Reference in new issue