2009-09-28 18:36:36 +08:00
|
|
|
libDir = node.path.join(node.path.dirname(__filename), "../lib");
|
|
|
|
node.libraryPaths.unshift(libDir);
|
|
|
|
include("/utils.js");
|
2009-07-13 18:48:59 +08:00
|
|
|
function next (i) {
|
|
|
|
if (i <= 0) return;
|
|
|
|
|
2009-08-27 04:11:51 +08:00
|
|
|
var child = node.createChildProcess("echo hello");
|
2009-07-13 18:48:59 +08:00
|
|
|
|
2009-08-27 04:11:51 +08:00
|
|
|
child.addListener("output", function (chunk) {
|
2009-07-13 18:48:59 +08:00
|
|
|
if (chunk) print(chunk);
|
|
|
|
});
|
|
|
|
|
2009-08-27 04:11:51 +08:00
|
|
|
child.addListener("exit", function (code) {
|
2009-09-28 22:50:19 +08:00
|
|
|
if (code != 0) process.exit(-1);
|
2009-07-13 18:48:59 +08:00
|
|
|
next(i - 1);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
next(500);
|