From 41e215ba0ddba9dccea153d311e1498f35b36e52 Mon Sep 17 00:00:00 2001 From: Willi Goesgens Date: Tue, 7 Oct 2014 09:23:59 +0200 Subject: [PATCH] Add count of how many tests failed to the summary. --- js/server/modules/org/arangodb/testing.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/server/modules/org/arangodb/testing.js b/js/server/modules/org/arangodb/testing.js index 8914574223..d70b0fed6e 100644 --- a/js/server/modules/org/arangodb/testing.js +++ b/js/server/modules/org/arangodb/testing.js @@ -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: ");