Add a unit test in the test suite
| 61 | |
| 62 | // Add a unit test in the test suite |
| 63 | void TestSuite::addTest(Test* test) { |
| 64 | if (test == nullptr) { |
| 65 | throw std::invalid_argument("Error : You cannot add a nullptr test in the test suite."); |
| 66 | } |
| 67 | else if (mOutputStream != nullptr && test->getOutputStream() == nullptr) { |
| 68 | test->setOutputStream(mOutputStream); |
| 69 | } |
| 70 | |
| 71 | // Add the test to the suite |
| 72 | mTests.push_back(test); |
| 73 | |
| 74 | // Reset the added test |
| 75 | test->reset(); |
| 76 | } |
| 77 | |
| 78 | // Add a test suite to the current test suite |
| 79 | void TestSuite::addTestSuite(const TestSuite& testSuite) { |
no test coverage detected