Display the tests report and return the number of failed tests
| 108 | |
| 109 | // Display the tests report and return the number of failed tests |
| 110 | long TestSuite::report() const { |
| 111 | if (mOutputStream != nullptr) { |
| 112 | long nbFailedTests = 0; |
| 113 | |
| 114 | *mOutputStream << "Test Suite \"" << mName << "\"\n"; |
| 115 | size_t i; |
| 116 | for (i=0; i < 70; i++) { |
| 117 | *mOutputStream << "="; |
| 118 | } |
| 119 | *mOutputStream << "=" << std::endl; |
| 120 | for (i=0; i < mTests.size(); i++) { |
| 121 | assert(mTests[i] != nullptr); |
| 122 | nbFailedTests += mTests[i]->report(); |
| 123 | } |
| 124 | for (i=0; i < 70; i++) { |
| 125 | *mOutputStream << "="; |
| 126 | } |
| 127 | *mOutputStream << "=" << std::endl; |
| 128 | |
| 129 | // Return the number of failed tests |
| 130 | return nbFailedTests; |
| 131 | } |
| 132 | else { |
| 133 | return getNbFailedTests(); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | // Delete all the tests |
| 138 | void TestSuite::clear() { |