Make reporting tool use standard input.

This commit is contained in:
Michael Bebenita 2015-04-29 10:17:47 -07:00 коммит произвёл Yury Delendik
Родитель 99cd4eca13
Коммит 259c14e243
1 изменённых файлов: 21 добавлений и 31 удалений

Просмотреть файл

@ -1,11 +1,3 @@
var commandLineArguments;
// SpiderMonkey
if (typeof scriptArgs === "undefined") {
commandLineArguments = arguments;
} else {
commandLineArguments = scriptArgs;
}
var fileCount = 0; var fileCount = 0;
var passCount = 0; var passCount = 0;
var finishedCount = 0; var finishedCount = 0;
@ -14,31 +6,29 @@ var zeroHashCount = 0;
var histogramNames = ["Not Implemented", "somewhatImplemented", "Uncaught VM-internal", "AVM1 error", "AVM1 warning", "Tag not handled by the parser", "Unable to resolve"] var histogramNames = ["Not Implemented", "somewhatImplemented", "Uncaught VM-internal", "AVM1 error", "AVM1 warning", "Tag not handled by the parser", "Unable to resolve"]
var histograms = {}; var histograms = {};
commandLineArguments.forEach(function (file) { while (true) {
var line = readline();
var file = commandLineArguments[0]; if (line === null) {
break;
read(file).toString().split("\n").forEach(function (k) { }
if (k.indexOf("RUNNING:") === 0) { if (line.indexOf("RUNNING:") === 0) {
fileCount++; fileCount++;
} else if (k.indexOf("HASHCODE:") === 0) { } else if (line.indexOf("HASHCODE:") === 0) {
if (k.indexOf(': 0x00000000') > 0) { if (line.indexOf(': 0x00000000') > 0) {
zeroHashCount++ zeroHashCount++
} else { } else {
passCount++ passCount++
}
finishedCount++;
} }
for (var i = 0; i < histogramNames.length; i++) { finishedCount++;
var n = histogramNames[i]; }
if (k.indexOf(n) >= 0) { for (var i = 0; i < histogramNames.length; i++) {
if (!histograms[n]) histograms[n] = []; var n = histogramNames[i];
histograms[n].push(k); if (line.indexOf(n) >= 0) {
} if (!histograms[n]) histograms[n] = [];
histograms[n].push(line);
} }
// print(k); }
}); }
});
function histogram(array, min) { function histogram(array, min) {
min = min || 0; min = min || 0;