| 97 | |
| 98 | |
| 99 | void runTestCase(TestCase::Config const& _config, TestCase::TestCaseCreator const& _testCaseCreator) |
| 100 | { |
| 101 | try |
| 102 | { |
| 103 | std::stringstream errorStream; |
| 104 | auto testCase = _testCaseCreator(_config); |
| 105 | if (testCase->shouldRun()) |
| 106 | switch (testCase->run(errorStream)) |
| 107 | { |
| 108 | case TestCase::TestResult::Success: |
| 109 | break; |
| 110 | case TestCase::TestResult::Failure: |
| 111 | BOOST_ERROR("Test expectation mismatch.\n" + errorStream.str()); |
| 112 | break; |
| 113 | case TestCase::TestResult::FatalError: |
| 114 | BOOST_ERROR("Fatal error during test.\n" + errorStream.str()); |
| 115 | break; |
| 116 | } |
| 117 | } |
| 118 | catch (...) |
| 119 | { |
| 120 | BOOST_ERROR("Exception during extracted test: " << boost::current_exception_diagnostic_information()); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | int registerTests( |
| 125 | boost::unit_test::test_suite& _suite, |
no test coverage detected