Re: No Love from XCTest
Re: No Love from XCTest
- Subject: Re: No Love from XCTest
- From: P S <email@hidden>
- Date: Wed, 12 Feb 2014 17:05:16 -0500
Folks,
This should have been obvious to me, but I just discovered that though the debug console never comes up when I'm trying to run my tests, I can use the menu option to force it to appear. This allowed me to discover the error which is that the bundle cannot be loaded "IDEBundleInjection.c: Error loading bundle". Armed with that error message, I was able to find a lot more information on the web about possible causes. For some reason, it appears as if my simulator selection was set to a 64-bit iPhone. That seems to be unsupported. I'm stil not entirely sure if that was the extent of my problem, but I'm finally able to run some XCTestCases in my project.
Regards,
Paul
On Feb 12, 2014, at 1:17 PM, P S <email@hidden> wrote:
> Re: XCode 5.0.2, iOS 7
>
> Folks,
>
> I'm trying to make sense and use of the new XCTest functionality. We have thousands of SenTests, and I'm not ready to deal with the migration tool just yet. I'd like to start by building just a few tests using the new framework to see how it goes. Unfortunately, I'm getting nowhere fast. I've watched the WWDC 2013 video, and I've read over the "Unit Test Your App" documentation guide. Both seem to gloss over a lot of the details and assume that everything is just going to work if you click on the right buttons in the Xcode UI.
>
> What I've been able to glean so far is that unit tests are based on a new target type that you can create using the standard Add Target... UI or by starting the same wizard from the Test Navigator UI by clicking on the + button. Once you've done that, it seems like Xcode starts creating cruft without asking you, and I've battled through this process once or twice, trying to get everything arranged the way I want. For example, I already have a UnitTests folder in my project, and I want to keep all unit test related files in this folder. I discovered that I needed to name my new target exactly "UnitTests" and then xcode would create its new files in the location I wanted.
>
> So far, so good, or so I thought. Xcode also added a reference to the XCTest.framework, but I noticed the icon in the left pane was in red. The full path to the framework was invalid, but I was able to locate the proper path to the framework inside the Xcode app bundle and resolve that issue.
>
> I next used the New File wizard to create a unit test. I added the file as a member of the UnitTests target. Everything looked good in the navigator, and so I clicked to run one of my tests. The test is very simply:
>
> - (void)testSuccess
> {
> XCTAssertTrue(YES, @"We did it!");
> }
>
> Xcode builds and launches the simulator, and I see our app's splash screen appear briefly, and then the app in the simulator appears to just crash. No debugger window appears, there is no console output that I can find related to this crash, and I see nothing in the xcode UI indicating that any of the tests succeeded or failed or were even run. I've of course tried, building clean, cleaning the build folder, deleting all derived data from the organizer, quitting and restarting xcode, etc, etc. The results are always the same.
>
> I figured maybe this was a result of some issues in our project configuration, so I decided to try using an Apple provided example project as my starting point. I chose the SimpleStocks project. I used only the GUI tools to add some unit tests (following the same steps that I saw on the video), and ran the auto generated SimpleStocks_Tests class and got the same results. Everything compiled, but the simulator launched, the stocks app appeared briefly, then seemed to crash, and no tests were run and no crash information was logged anywhere that I could see.
>
> My first question is whether the simulator should even be launching. I didn't notice that happening when I watched the WWDC video. My second question is how do I figure out what's going wrong. If there is any additional documentation provided by Apple that goes into detail on testing, please point me in the right direction, and I will gladly go RTFM.
>
> Thanks,
> Paul
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden