-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Failing tests throw NSInternalInconsistencyException when using AppCode #740
Comments
Thanks for filing the issue. I confirmed the followings:
That means that we should be able to register __attribute__((constructor))
static void registerCurrentTestCaseTracker() {
[[XCTestObservationCenter sharedTestObservationCenter] addTestObserver:[CurrentTestCaseTracker sharedInstance]];
} ref: Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m Lines 45 to 81 in 446fa60
|
@mark-anders Could you try the branch |
FYI v8.0.8 has been released. |
Hi @ikesyo, sorry for the delay. I was traveling and wasn't able to test previously. Thank you so much for the quick fix. It works great. |
I've been using Nimble successfully for years with Xcode and JetBrains' AppCode. However, with recent versions of AppCode that support Swift 5 (which use Xcode 11.4), any test failure throws an NSInternalInconsistencyException right after reporting the error that occurred.
I filed a bug with JetBrains and they narrowed it down to the use of swizzling in the
+load
methodXCTestObservationCenter+Register
. You can see that bug here:https://youtrack.jetbrains.com/issue/OC-19997.
The solution was to replace the swizzling code with the following, which I tried and it worked.
The comment for
+load
indicates that the swizzling was done due an issue with Xcode 7.3. However, Nimble 9.0.0 now requires 11.4 and it could be that the issue no longer exists. In my fork, I ran all tests for all platforms and everything passed, so it may not be required any longer.I have a fix and could submit a pull request.
The text was updated successfully, but these errors were encountered: