-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-tap.js
38 lines (33 loc) · 964 Bytes
/
run-tap.js
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
36
37
38
// The tapestry
var path = require('path');
// Remove nodePath, scriptpath from argv
var argv = require('minimist')(process.argv.slice(2),{
alias: { b: 'buffer' }
});
var testDeck = eval(unescape(decodeURI(argv.buffer)));
if( typeof testDeck !== 'object' ) {
throw "Could not read buffer from argument vector";
};
var os = require('os').type();
var estktap = require('estktap');
var d = testDeck.length;
while (d--) {
var tests = testDeck[d];
var descr = tests.description;
var targets = tests.targets;
var comparator = tests.comparator;
var scripts = tests.scripts;
var s = scripts.length;
while (s--) {
var script = scripts[s];
var x = targets.length;
var scriptName = '';
while (x--) {
var myTarget = targets[x];
if(tests.addScriptName) {
scriptName = ' ' + path.basename(script);
};
estktap(os + ' ' + myTarget + scriptName + ': ' + descr, script, comparator, [myTarget]);
};
};
};