How to run a Unit Test
I have an Xcode 4.2 project with unit tests, how do I run them in AppCode. I can't find any menu command to run the tests. One would think that would be an easy thing to rund, a test instead of run menu command.
Gee, one main reason I do not use AppCode is the lack of documentation is a killer.
请先登录再写评论。
Hi,
You first add a new OCUnit target to your AppCode project from the Run menu (Edit Configurations). Then you can select the UnitTest target in the upper right corner of the IDE and run your tests with the green arrow.
With regards,
Rutger
You can also run a test from the current context with a shortcut or a menu:
Is there a "trick" in App code for running the OCUnit tests after the app is launched.
Is there a document that describes running the tests without the app and with the app?
Thanks!
Dave,
AppCode doesn't have any special configuration - it simply runs tests from the corresponding targets for you.
There are 2 types of unit tests in OC - Logic and Application (I guess you refer to the latter when saying "running tests when after the app is launched").
You can check apple's documentation regarding the configuration of various types of tests: http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/UnitTesting/00-About_Unit_Testing/about.html#//apple_ref/doc/uid/TP40002143-CH1-SW1
Regards,
Anton Makeev
Thanks for the link.
Does App Code support creating test classes like intellij does? If not I think that's a feature that should be added.
Thanks,
Dave Crane
www.lonemoosesoftware.com
Not yet,
here are two requests for you to follow:
http://youtrack.jetbrains.com/issue/OC-2622
http://youtrack.jetbrains.com/issue/OC-4192