How to run a subset of the unit tests with Xcode 4 - xcode

Xcode 4 introduces the scheme feature. With which you can create different schemes for your project. Under the test item in a scheme you can select which tests to run. However, I'm finding that all the tests are run, not just the ones I'm selecting. How can I just run a subset of my unit tests?
I suspect my problem is related to the fact that my project and unit tests were originally created with Xcode 3 and imported into Xcode 4.
There was an earlier question about this sort of problem, but my question is specifically about Xcode 4.0.2.

This was fixed in a post 4.0 release of Xcode. I'm using 4.5 and it is fixed this release, but I don't know the exact release it was fixed in.

Related

Checked Out New Project in XCode 6.1 but XCTest and other libraries are missing

Today I checked out a new copy of stable project from gitHub to my home computer using Xcode 6.1. After doing so, I see that many of the frameworks and libraries, including XCTest, are missing (shown in red). I have added Framework and Header Search Paths, but they are still not found.
To make things stranger, I can build the project to a simulator or device, but when I try to run an individual test, I get clang or missing file error for the libraries/frameworks shown in red.
As it turns out, the reason for my errors was that I had not run "Build for Testing" before trying to run the individual Unit Tests. As such, the proper library dependencies had not been generated.

Can you run unit tests as part of building your app in Xcode 5?

In Xcode 4.x any unit tests (logic tests) could run as part of building your main target.
Is a similar setup possible for Xcode 5?
Update
The issue boils down to Xcode launching the simulator as part of running logic tests. That wasn't the case with Xcode 4.x
Have created a radar to track this http://openradar.appspot.com/15859153
To build and run unit tests after building the other targets in the active scheme, use command-U.

Is it possible to run jenkins with two different iOS sdks

We are using Jenkins to run our xcodebuilds on a Mac Mini server. In the last weeks we started development of iOS 7 apps and we installed Xcode 5 DP versions on the Mac Mini.
When installing a new Xcode version and configuring the xcodebuild of the new Xcode which xcode-select this new version is also used for building our old iOS 6 apps - which breaks the UI of them.
Is there a way to tell Jenkins which xcodebuild it should use to build a project?
Check out the solution posted by Andy Molloy at http://andymolloy.net/specifying-xcode-version-for-jenkins-projects.
You have to install EnvInject plugin for Jenkins and add DEVELOPER_DIR=/Applications/Xcode5-DP6.app/Contents/Developer environment variable to your build job.
It doesn't look like it is possible to specify xcode version per jenkins job. Also switching xcode version on the command line requires root permissions.
You might manage to solve your issue by making sure your IOS 6 apps, when built with the new xcode, work properly. Try selecting the proper base SDK and deployment target http://www.clarkcox.com/blog/2009/06/23/sdks-and-deployment-targets/
If that won't work you could try forcing a switch of the xcode version to use at build time, pre xcode plugin use. You will have to fiddle with sudo rights. Given that this is a system setting, you might need to prevent multiple builds from happening simultaneously.
I would do my best getting the multiple builds working with a single xcode version though.
Select the xcode version at runtime
Use EnvInject plugin
for jobs that require the non default do something like
DEVELOPER_DIR=/Applications/Xcode6.0.1.app/Contents/Developer
under Inject environment variables to the build process
https://wiki.jenkins-ci.org/display/JENKINS/Xcode+Plugin

display all the resolved issues since the previous build

I have two build configurations- a dev configuration (builds on every checkin), and a QA configuration (builds on-demand, whenever a version for qa is released. We don't do continuous deployment (yet)).
When a version for QA is released, I'd like to be able to know what issues have been resolved since the last version. (format is not important- report / chart / text...),
Meaning- i'd like to know all the issues that have been changed to 'resolved' since the date of the last build in this configuration.
I'm using tfs teamcity issue tracker.
Any ideas?
You probably know already that TC has a "Fixed in Build" value?
I find it tricky to use because if we click 'build' once too often, the list of resolved issues gets all messed up.
Thus I'm also interested in expanding the feature, I just posted;
http://devnet.jetbrains.net/thread/438721
API to access "Fixed in Build" value?

What automated build system do Mac developers use?

my team is currently using buildbot to automate overnight and continuous-integration builds and regression tests. For builds and unit tests, the builder just invokes a script which syncs the sources from p4 and then runs xcodebuild. The regression tests are also launched by a shell script, and are themselves combinations of shell scripts and AppleScripts. The builds are all performed on one system but then buildbot triggers tests to happen on multiple Macs, with different architecture and OS combinations. The things I like about buildbot are the automatic triggers (so the tests run only if and when the build succeeds), and the reporting including the waterfall view to see the overall status.
However, I see a number of problems too. The "master" process which coordinates the builds is either leaky or just has a huge working set which means that it consumes a couple of gigabytes of memory. Occasionally network problems mean that a slave will be lost; rather than retrying later it will just fail the build. In fact if the slave is supposed to be triggered for a dependent build, it will fail the first build after it has otherwise successfully completed.
So what are the rest of you using to automate your Xcode builds and unit tests? How do those solutions work for you? Anything you would recommend?
I use TeamCity in a windows environment but I believe it will work on Mac and has xcode build agents.
Another similar question here.
Our team use Hudson with a script which converts the Unit Test output from XCode to NUnit format.
I know this is an older question, but for those using TFS to hold their Xcode projects, I created a custom build activity to make automating Xcode builds via TFS easier. The code is hosted on Codeplex here: http://tfsxcodebuild.codeplex.com/.
Hope someone finds it useful!
We worked out what was using all the memory - log files - older buildbot keeps all logs forever and keeps them in memory (possibly until a restart).
Newer buildbot can be configured to keep a fixed amount of history.
Buildbot build log files should be limited in size to avoid the problem.
I use the XcodeBuilder that's part of CruiseControl. Of course it helps that I wrote it. :)
But I did use it on a real multiple person project for an iPhone app (Surf) that's for sale in the app store.
Now that it's three years later I have my own answer to provide to this question. I'm using Jenkins, mainly for the plug-ins that it provides. It has a plug-in for building targets in Xcode projects (or schemes in workspaces). There's a plug-in to run the Clang static analyzer. It interfaces with my bug-tracker system, it'll automatically push builds to Testflight too.

Resources