-
Notifications
You must be signed in to change notification settings - Fork 42
Make compatible with xctool and Xcode 7 #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this was done because registerTestClasses could implicitly invoke [GoogleTestCase initialize] and cause duplicated class registration because check if ([GoogleTestFilterMap count]) will fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling +initialize is frowned upon in ObjC; I think what you want is
if (self == [GoogleTestCase class]) {
[self registerTestClasses];
}
Does that solve it getting called twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
I had the bug where registerTestClasses was called twice, this is how I fixed it (I created the pull request also):
NSArray* loadedClasses = [notification.userInfo objectForKey:NSLoadedClasses];
if( loadedClasses != nil ) {
if( [loadedClasses indexOfObject:@"GoogleTestLoader"] != NSNotFound) {
[self registerTestClasses];
}
}
|
Ping @mattstevens. |
|
moving tests registration into +initialize doesn't work properly, as it happens right
and before C++ .ctors for static global variables (aka Google tests) are run OTOH, parameterized tests method name sanitizing looks good |
|
Merged method name sanitizing into https://github.com/eugenegff/xcode-googletest fork |
Current implementation isn't compatible with xctool and Xcode 7 because xctool couldn't query test cases.
This PR fixes it.
Test plan: