08-27-周三_17-09-29

This commit is contained in:
2025-08-27 17:10:05 +08:00
commit 86df397d8f
12735 changed files with 1145479 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
var WebSocket = require('../lib/faye/websocket'),
pace = require('pace');
var host = 'ws://localhost:9001',
agent = 'Node ' + process.version,
cases = 0,
skip = [];
var socket = new WebSocket.Client(host + '/getCaseCount'),
progress;
socket.onmessage = function(event) {
console.log('Total cases to run: ' + event.data);
cases = parseInt(event.data);
progress = pace(cases);
};
socket.onclose = function() {
var runCase = function(n) {
progress.op();
if (n > cases) {
socket = new WebSocket.Client(host + '/updateReports?agent=' + encodeURIComponent(agent));
socket.onclose = process.exit;
} else if (skip.indexOf(n) >= 0) {
runCase(n + 1);
} else {
socket = new WebSocket.Client(host + '/runCase?case=' + n + '&agent=' + encodeURIComponent(agent));
socket.onmessage = function(event) {
socket.send(event.data);
};
socket.onclose = function() {
runCase(n + 1);
};
}
};
runCase(1);
};