| 3991 | } |
| 3992 | |
| 3993 | inline std::size_t registerTestMethods() { |
| 3994 | std::size_t noTestMethods = 0; |
| 3995 | int noClasses = objc_getClassList( nullptr, 0 ); |
| 3996 | |
| 3997 | Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses); |
| 3998 | objc_getClassList( classes, noClasses ); |
| 3999 | |
| 4000 | for( int c = 0; c < noClasses; c++ ) { |
| 4001 | Class cls = classes[c]; |
| 4002 | { |
| 4003 | u_int count; |
| 4004 | Method* methods = class_copyMethodList( cls, &count ); |
| 4005 | for( u_int m = 0; m < count ; m++ ) { |
| 4006 | SEL selector = method_getName(methods[m]); |
| 4007 | std::string methodName = sel_getName(selector); |
| 4008 | if( startsWith( methodName, "Catch_TestCase_" ) ) { |
| 4009 | std::string testCaseName = methodName.substr( 15 ); |
| 4010 | std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); |
| 4011 | std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); |
| 4012 | const char* className = class_getName( cls ); |
| 4013 | |
| 4014 | getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) ); |
| 4015 | noTestMethods++; |
| 4016 | } |
| 4017 | } |
| 4018 | free(methods); |
| 4019 | } |
| 4020 | } |
| 4021 | return noTestMethods; |
| 4022 | } |
| 4023 | |
| 4024 | #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) |
| 4025 |
no test coverage detected