This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
forked from scriptish/scriptish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
45 lines (40 loc) · 1.42 KB
/
test.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
39
40
41
42
43
44
45
#!/usr/bin/env node
var exec = require('child_process').exec;
var debug = ("debug" == process.argv[2]);
exec("./build.sh test", function() {
console.log("Running mozmill tests...");
if (debug) {
exec("mozmill -t tests/mozmill-tests -a scriptish-test.xpi --show-all", doAsycTests.bind(null, 0));
} else {
exec("mozmill -t tests/mozmill-tests -a scriptish-test.xpi", doAsycTests.bind(null, 0));
}
});
function dumpResults(e, out) {
if (out) console.log(out);
}
function doAsycTests(step, e, out) {
dumpResults(e, out);
step = step || 0;
switch (step) {
case 4:
console.log("Running mozmill-restart tests...");
if (debug) {
exec("mozmill-restart -t tests/mozmill-tests/tests/restartTests -a scriptish-test.xpi --show-all", dumpResults);
} else {
exec("mozmill-restart -t tests/mozmill-tests/tests/restartTests -a scriptish-test.xpi", dumpResults);
}
return;
case 0:
console.log("Starting restart tests in 10 secs... (Press ctrl+z to cancel)");
return setTimeout(doAsycTests.bind(null, ++step), 7000);
case 1:
console.log("Starting restart tests in 3 secs...");
return setTimeout(doAsycTests.bind(null, ++step), 1000);
case 2:
console.log("Starting restart tests in 2 secs...");
return setTimeout(doAsycTests.bind(null, ++step), 1000);
case 3:
console.log("Starting restart tests in 1 secs...");
return setTimeout(doAsycTests.bind(null, ++step), 1000);
}
}