| 4322 | } |
| 4323 | |
| 4324 | inline std::size_t registerTestMethods() { |
| 4325 | std::size_t noTestMethods = 0; |
| 4326 | int noClasses = objc_getClassList( nullptr, 0 ); |
| 4327 | |
| 4328 | Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses); |
| 4329 | objc_getClassList( classes, noClasses ); |
| 4330 | |
| 4331 | for( int c = 0; c < noClasses; c++ ) { |
| 4332 | Class cls = classes[c]; |
| 4333 | { |
| 4334 | u_int count; |
| 4335 | Method* methods = class_copyMethodList( cls, &count ); |
| 4336 | for( u_int m = 0; m < count ; m++ ) { |
| 4337 | SEL selector = method_getName(methods[m]); |
| 4338 | std::string methodName = sel_getName(selector); |
| 4339 | if( startsWith( methodName, "Catch_TestCase_" ) ) { |
| 4340 | std::string testCaseName = methodName.substr( 15 ); |
| 4341 | std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); |
| 4342 | std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); |
| 4343 | const char* className = class_getName( cls ); |
| 4344 | |
| 4345 | getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) ); |
| 4346 | noTestMethods++; |
| 4347 | } |
| 4348 | } |
| 4349 | free(methods); |
| 4350 | } |
| 4351 | } |
| 4352 | return noTestMethods; |
| 4353 | } |
| 4354 | |
| 4355 | #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) |
| 4356 |
no test coverage detected