| 197 | |
| 198 | |
| 199 | static void RunTest(const std::string& suiteName, const std::string& testName, TestPtr testPtr) |
| 200 | { |
| 201 | try |
| 202 | { |
| 203 | if (testPtr) |
| 204 | { |
| 205 | ran_count++; |
| 206 | int pre_count = macro_count; |
| 207 | testPtr(); |
| 208 | if (macro_count > pre_count) |
| 209 | TCERR << "PASSED" << std::endl; |
| 210 | else |
| 211 | skip("Test did not make any TEST assertions"); |
| 212 | } |
| 213 | return; |
| 214 | } |
| 215 | catch (skip_exception& e) |
| 216 | { |
| 217 | TCERR << "SKIPPED: " << e.what() << std::endl; |
| 218 | |
| 219 | std::stringstream sstr; |
| 220 | sstr << "Test " << suiteName << "/" << testName << ": " << e.what(); |
| 221 | skipped_strings.push_back(sstr.str()); |
| 222 | |
| 223 | skipped_count++; |
| 224 | } |
| 225 | catch (eError& error) |
| 226 | { |
| 227 | TCERR << "FAILED: "; |
| 228 | cTWUtil::PrintErrorMsg(error); |
| 229 | |
| 230 | std::stringstream sstr; |
| 231 | sstr << "Test " << suiteName << "/" << testName << ": " << error.GetMsg(); |
| 232 | error_strings.push_back(sstr.str()); |
| 233 | |
| 234 | failed_count++; |
| 235 | } |
| 236 | catch (std::exception& e) |
| 237 | { |
| 238 | TCERR << "FAILED: " << e.what() << std::endl; |
| 239 | |
| 240 | std::stringstream sstr; |
| 241 | sstr << "Test " << suiteName << "/" << testName << ": " << e.what(); |
| 242 | error_strings.push_back(sstr.str()); |
| 243 | |
| 244 | failed_count++; |
| 245 | } |
| 246 | catch (...) |
| 247 | { |
| 248 | TCERR << "FAILED: <unknown>" << std::endl; |
| 249 | |
| 250 | std::stringstream sstr; |
| 251 | sstr << "Test " << suiteName << "/" << testName << ": <unknown>"; |
| 252 | error_strings.push_back(sstr.str()); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 |
no test coverage detected