Re: Automated unit-testing for iOS?
Re: Automated unit-testing for iOS?
- Subject: Re: Automated unit-testing for iOS?
- From: Eric Wing <email@hidden>
- Date: Thu, 01 Sep 2011 14:12:40 -0700
On 9/1/11, Jens Alfke <email@hidden> wrote:
> OK, this should be something easy and supported, but I can’t get it to work
> and can’t find docs on how to do it, so either I’m dumb or no one else cares
> about running unit tests on their continuous-build server…
>
> - We have an iOS library (Couchbase Mobile).
> - We have a minimal app that runs it, and a separate unit-test target that
> runs tests in the simulator.
> - All this was easy to set up in Xcode 4 and works great.
>
> - Our QA guy has automated builds set up in our Jenkins-based buildbot
> server (running ‘xcodebuild’.)
> - We also want the buildbot to run the unit tests, so it can turn the magic
> light red when the tests fail, and more usefully, block the code review
> system (Gerrit) from accepting the patch into trunk.
>
> All this is textbook agile-programming stuff, right? And yet I cannot figure
> out how to run the unit tests in an automated way. My co-worker has even
> proposed AppleScripting Xcode to choose the “Test” menu command … but I
> really don’t want to go down that road.
>
> Here’s what I’ve got:
> Xcode appears to run tests by invoking the shellscript
> /Developer/Tools/RunUnitTests. This in turn requires about a dozen
> environment variables to be set up, so I wrote a wrapper script that sets
> all of those first. Now the error I get is:
>
> /Developer/Platforms/iPhoneSimulator.platform/Developer/Tools/Tools/RunPlatformUnitTests:95:
> warning: Skipping tests; the iPhoneSimulator platform does not currently
> support application-hosted tests (TEST_HOST set).
>
> …which is a lie, because the simulator runs this same test bundle perfectly
> fine when Xcode tells it to.
> If I don’t set the TEST_HOST variable, so the tests will be treated as
> “logic” instead of “hosted”, I instead get the error
>
> otool: can't open file: /Developer/usr/bin/otest (No such file or directory)
>
> I’ve found some old blog posts that predate Xcode 4, and some questions on
> StackOverflow that have answers recommending I hack changes into
> RunPlatformUnitTests to take out that check for the simulator. I’d really
> rather not do that.
>
> So please tell me that this is actually easy and I just missed the obvious
> documentation?
>
> —Jens _______________________________________________
This is something I am interested in. I posted this 5 part article a
few weeks ago:
http://playcontrol.net/ewing/jibberjabber/automated-mobile-test-part1.html
I was hoping for more feedback and public discussion by posting this.
Unfortunately, my conclusion is that very few people care about
automated testing.
We also use Jenkins in our process. Our solution is a hodgepodge of
things including Scripting Bridge which you declared is not the path
you want to go down. Neither did we, but couldn't find better ways to
do it.
-Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/
_______________________________________________
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