-
Notifications
You must be signed in to change notification settings - Fork 908
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
Build error when running c++ tests in KIF #733
Comments
Tony/Brian, I don't know this area of KIF code at all, but I'm curious to know what we can do about the issue. Thanks, -----Original Message----- System macro is causing issues when running C++ tests in KIF In file included from /Users/test/Documents/iOS/Tests/test.mm:19: In file included from /Users/test/Documents/iOS/Tests/test.mm:19: 1 error generated. |
Clearly using macros with no prefix at global scope is a terrible idea. At the very least we could rename the macros to KIF_system and KIF_tester. But really we should get rid of them entirely. We need to anyway for Swift compatibility. Tony
|
Renaming to Assuming that KIF doesn't today work for anyone using C++, we could wrap it:
I am interested in why you're using Objective-C++ for tests. Are you using a C++ testing framework? Generally speaking, even if your app is written in Objective-C++, you should be able to do your KIF testing with Objective-C (or Swift). |
App is in C++ and these were existing C++ tests that I'm trying to automate. I've used KIF before for another app in objective C which worked well. tried adding the following to KIFSystemTestActor.h but getting a bunch of linker errors #ifdef __cplusplus Errors: Undefined symbols for architecture i386: |
bump is there another workaround for this issue? getting a build error after renaming system macro in KIF framework |
That means your test target is failing to link against UIKit. You need to add UIKit to your linked libraries and make sure you're using your app as the test host. Even if you already have a working unit test target, it's usually easiest to create a separate test target for KIF. I would just create a new Unit Testing Bundle and select the app as the test host. |
Thank you!! that got the tests running. |
According to kif-framework#733, this collides with stdlib. We have just encountered this ourselves in our code base.
I opened a PR here: #988 |
System macro is causing issues when running C++ tests in KIF
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale:192:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:131:9: error: expected unqualified-id
using ::system;
In file included from /Users/test/Documents/iOS/Tests/test.mm:19:
In file included from /Users/test/Library/Developer/Xcode/DerivedData/frxusjxqwcj/Build/Products/Debug-iphonesimulator/include/KIF/KIF.h:12:
/Users/test/Library/Developer/Xcode/DerivedData/fwcj/Build/Products/Debug-iphonesimulator/include/KIF/KIFSystemTestActor.h:13:16: note: expanded from macro 'system'
define system KIFActorWithClass(KIFSystemTestActor)
In file included from /Users/test/Documents/iOS/Tests/test.mm:19:
In file included from /Users/test/Library/Developer/Xcode/DerivedData/frxzxqwcj/Build/Products/Debug-iphonesimulator/include/KIF/KIF.h:10:
/Users/test/Library/Developer/Xcode/DerivedData/frxusqwcj/Build/Products/Debug-iphonesimulator/include/KIF/KIFTestActor.h:18:34: note: expanded from macro 'KIFActorWithClass'
define KIFActorWithClass(clazz) [clazz actorInFile:[NSString stringWithUTF8String:FILE] atLine:LINE delegate:self]
1 error generated.
Also reported here...
https://groups.google.com/forum/#!topic/kif-framework/qgWxVL644DU
Is there a workaround for this issue or will this be fixed?
Thanks
The text was updated successfully, but these errors were encountered: