我智商爆棚
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.
 
 
 
 
 

22 lines
539 B

var spawn = require('child_process').spawn,
join = require('path').join;
var files = require('fs').readdirSync(__dirname).filter(function(f) {
return (f.substr(0, 5) === 'test-');
}).map(function(f) {
return join(__dirname, f);
}),
f = -1;
function next() {
if (++f < files.length) {
spawn(process.argv[0], [ files[f] ], { stdio: 'inherit' })
.on('exit', function(code) {
if (code === 0)
process.nextTick(next);
else
process.exit(code);
});
}
}
next();