Created
September 27, 2010 06:55
-
-
Save nvkv/598706 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark Runtime stuff | |
- (void) collectTestClasses | |
{ | |
int classesCount = 0; | |
Class * c_list = NULL; | |
c_list = NULL; | |
classesCount = objc_getClassList(NULL, 0); | |
if (classesCount > 0) | |
{ | |
c_list = malloc(sizeof(Class) * classesCount); | |
classesCount = objc_getClassList(c_list, classesCount); | |
for (int i = 0; i < classesCount; i++) | |
{ | |
NSString *className = [NSString stringWithCString:class_getName(c_list[i]) | |
encoding:NSUTF8StringEncoding]; | |
if ([className hasSuffix:@"Tests"]) { | |
[testClasses addObject:className]; | |
} | |
} | |
free(c_list); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment