mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
725 B
41 lines
725 B
|
|
var TESTS = [
|
|
'test-spawn-and-execfile',
|
|
'test-fork',
|
|
'test-exec',
|
|
];
|
|
|
|
var execFile = require('child_process').execFile;
|
|
var passed = 0, failed = 0;
|
|
|
|
function next() {
|
|
var test = TESTS.shift();
|
|
if (!test)
|
|
done();
|
|
|
|
console.log("Running test: %s", test);
|
|
execFile(process.execPath, [test], { cwd: __dirname }, onExit);
|
|
}
|
|
|
|
function onExit(err, stdout, stderr) {
|
|
if (err) {
|
|
console.log("... failed:\n%s%s\n", stdout, stderr);
|
|
failed++;
|
|
} else {
|
|
console.log("... pass");
|
|
passed++;
|
|
}
|
|
|
|
next();
|
|
}
|
|
|
|
function done() {
|
|
console.log("Tests run: %d. Passed: %d. Failed: %d",
|
|
passed + failed,
|
|
passed,
|
|
failed);
|
|
|
|
process.exit(+(failed > 0));
|
|
}
|
|
|
|
next();
|
|
|