| 4715 | } |
| 4716 | |
| 4717 | inline std::size_t registerTestMethods() { |
| 4718 | std::size_t noTestMethods = 0; |
| 4719 | int noClasses = objc_getClassList( nullptr, 0 ); |
| 4720 | |
| 4721 | Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses); |
| 4722 | objc_getClassList( classes, noClasses ); |
| 4723 | |
| 4724 | for( int c = 0; c < noClasses; c++ ) { |
| 4725 | Class cls = classes[c]; |
| 4726 | { |
| 4727 | u_int count; |
| 4728 | Method* methods = class_copyMethodList( cls, &count ); |
| 4729 | for( u_int m = 0; m < count ; m++ ) { |
| 4730 | SEL selector = method_getName(methods[m]); |
| 4731 | std::string methodName = sel_getName(selector); |
| 4732 | if( startsWith( methodName, "Catch_TestCase_" ) ) { |
| 4733 | std::string testCaseName = methodName.substr( 15 ); |
| 4734 | std::string name = Detail::getAnnotation( cls, "Name", testCaseName ); |
| 4735 | std::string desc = Detail::getAnnotation( cls, "Description", testCaseName ); |
| 4736 | const char* className = class_getName( cls ); |
| 4737 | |
| 4738 | getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) ); |
| 4739 | noTestMethods++; |
| 4740 | } |
| 4741 | } |
| 4742 | free(methods); |
| 4743 | } |
| 4744 | } |
| 4745 | return noTestMethods; |
| 4746 | } |
| 4747 | |
| 4748 | #if !defined(CATCH_CONFIG_DISABLE_MATCHERS) |
| 4749 |
no test coverage detected