1 var spawn = require('child_process').spawn
7 fs.readdir(__dirname, function (e, files) {
10 var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'})
12 var next = function () {
13 if (tests.length === 0) process.exit(exitCode);
15 var file = tests.shift()
17 var proc = spawn('node', [ 'tests/' + file ])
20 var t = setTimeout(function () {
23 console.error(file + ' timeout')
27 proc.stdout.pipe(process.stdout)
28 proc.stderr.pipe(process.stderr)
29 proc.on('exit', function (code) {
30 if (code && !killed) console.error(file + ' failed')