forked from sarendipitee/jshtml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
36 lines (24 loc) · 644 Bytes
/
Copy pathtest.js
File metadata and controls
36 lines (24 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var cp = require('child_process');
var assert = require('assert');
var fs = require('fs');
var srcDir = __dirname + '/test';
var testList = [];
function next() {
var test = testList.shift();
if(!test) return;
console.log();
console.log(test);
console.log();
var proc = cp.spawn('node', [test], {cwd: srcDir, customFds: [process.stdin.fd, process.stdout.fd, process.stderr.fd]});
proc.on('exit', function (code, signal) {
console.log();
assert.ifError(code);
next();
});
}
fs.readdirSync(srcDir).forEach(function(file) {
var match = /(.+)\.js$/i.exec(file);
if (!match) return;
testList.push(match[1]);
});
next();