1
0
Fork 0

Rearange the outputs of our tests so it matches the structure required by the unittest framework

This commit is contained in:
Willi Goesgens 2014-09-24 11:41:51 +02:00
parent 44d87e1ba5
commit 5b4209d95e
1 changed files with 10 additions and 4 deletions

View File

@ -133,16 +133,13 @@ var loadTestRunner = function (tests, options, testMethods) {
if (typeof(test.func) === "function") {
var resultSet;
resultSet = measure(test, options);
results[test.name] = resultSet;
results[test.name].status = true;
var oneResult;
for (oneResult in resultSet) {
if (resultSet.hasOwnProperty(oneResult) && (oneResult !== 'status')) {
results[test.name + '/' + oneResult] = {status: true};
var stats = calc(resultSet[oneResult], options);
results[test.name][oneResult][0].calced = stats;
results[test.name][oneResult].status = true;
for (j = 0; j < measurements.length;j ++) {
if (stats.hasOwnProperty(measurements[j])) {
@ -162,12 +159,21 @@ var loadTestRunner = function (tests, options, testMethods) {
pad(stats[measurements[j]].avg.toFixed(options.digits), cellLength, "left") + sep +
pad(stats[measurements[j]].har.toFixed(options.digits), cellLength, "left") + sep +
pad(stats[measurements[j]].rat.toFixed(2), runsLength, "left") + sep + measurements[j]);
for (var calculation in stats[measurements[j]]) {
results[test.name + '/' + oneResult][measurements[j] + '/' + calculation] = {
status: true,
message: '',
duration: stats[measurements[j]][calculation]
};
}
}
}
print(new Array(lineLength).join("-"));
}
}
}
}
for (i = 0; i < tests.length; ++i) {