1
0
Fork 0

Add count of how many tests failed to the summary.

This commit is contained in:
Willi Goesgens 2014-10-07 09:23:59 +02:00
parent a62d83603e
commit 41e215ba0d
1 changed files with 7 additions and 0 deletions

View File

@ -1114,6 +1114,8 @@ function unitTestPrettyPrintResults(r) {
var testrun;
var test;
var oneTest;
var testFail = 0;
var testSuiteFail = 0;
try {
for (testrun in r) {
@ -1125,6 +1127,7 @@ function unitTestPrettyPrintResults(r) {
print(" " + test + ": Success");
}
else {
testSuiteFail += 1;
if (r[testrun][test].hasOwnProperty('message')) {
print(" " + test + ": Fail - Whole testsuite failed!");
if (typeof r[testrun][test].message === "object" &&
@ -1141,6 +1144,7 @@ function unitTestPrettyPrintResults(r) {
if ((r[testrun][test].hasOwnProperty(oneTest)) &&
(internalMembers.indexOf(oneTest) === -1) &&
(!r[testrun][test][oneTest].status)) {
testFail =+ 1;
print(" -> " + oneTest + " Failed; Verbose message:");
print(r[testrun][test][oneTest].message);
}
@ -1152,6 +1156,9 @@ function unitTestPrettyPrintResults(r) {
}
}
print("Overall state: " + ((r.all_ok === true) ? "Success" : "Fail"));
if ((r.all_ok !== true) {
print(" Suites failed: " + testSuiteFail + " Tests Failed: " + testFail);
}
}
catch (x) {
print("exception caught while pretty printing result: ");