0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/mjsunit/test-process-spawn-loop.js
2009-06-28 19:08:26 +02:00

30 lines
469 B
JavaScript

include("mjsunit.js");
var N = 40;
var finished = false;
function spawn (i) {
var p = new node.Process('python -c "print 500 * 1024 * \'C\'"');
var output = "";
p.addListener("Output", function(chunk) {
if (chunk) output += chunk;
});
p.addListener("Exit", function () {
//puts(output);
if (i < N)
spawn(i+1);
else
finished = true;
});
}
function onLoad () {
spawn(0);
}
function onExit () {
assertTrue(finished);
}