Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[Q] Using OCUnit on Intel, how do I also run my unit tests..

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  Encrypted USB-stick for Mac OS X and Windows XP?  
Author Message
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 974



(Msg. 1) Posted: Wed Jan 16, 2008 5:00 am
Post subject: [Q] Using OCUnit on Intel, how do I also run my unit tests under Rosetta?
Archived from groups: comp>sys>mac>programmer>help (more info?)

Summary: I'm Using OCUnit on Intel. How do I also run my unit tests
under Rosetta?

I've got an XCode project with Unit Tests, as documented in:

Test Driving Your Code with OCUnit
http://developer.apple.com/tools/unittest.html

When I add the Unit Test target, Xcode modifies the build steps of my
app, adding a Run Script phase which does:

"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"


Now, according to the man page for RunUnitTests, on Leopard,
RunUnitTests looks at the environment variable ARCHS.

and in fact, when I modify the Run Script phase to:

"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
ARCHS=ppc;export ARCHS
"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"


the build log says:
Now Running i386 tests
.....
Now Running ppc tests


This is all as it should be, BUT: when I actually write an architecture
dependent test, I discover that RunUnitTests lies. I verified that my
unit test bundle IS being built Universal (by default it is
${NATIVE_ARCH}).

My question: What must I do so that my unit tests run, as part of an
Xcode build, both Intel, and PowerPC (i.e. Rosetta), when I'm building
on a Intel machine?

Extra credit: How about Intel-32, Intel-64, PowerPC-32, PowerPC-64?

 >> Stay informed about: [Q] Using OCUnit on Intel, how do I also run my unit tests.. 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 974



(Msg. 2) Posted: Thu Jan 17, 2008 9:01 pm
Post subject: Re: [Q] Using OCUnit on Intel, how do I also run my unit tests under Rosetta? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
David Phillip Oster wrote:

> Summary: I'm Using OCUnit on Intel. How do I also run my unit tests
> under Rosetta?
>
> I've got an XCode project with Unit Tests, as documented in:
>
> Test Driving Your Code with OCUnit
> http://developer.apple.com/tools/unittest.html
>
> When I add the Unit Test target, Xcode modifies the build steps of my
> app, adding a Run Script phase which does:
>
> "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
>
>
> Now, according to the man page for RunUnitTests, on Leopard,
> RunUnitTests looks at the environment variable ARCHS.
>
> and in fact, when I modify the Run Script phase to:
>
> "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
> ARCHS=ppc;export ARCHS
> "${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests"
>
>
> the build log says:
> Now Running i386 tests
> ....
> Now Running ppc tests

Answer: the above works. It works as advertised. My previous assertion
that it did not work was my mistake.

Hats off to Apple for making this so easy.

 >> Stay informed about: [Q] Using OCUnit on Intel, how do I also run my unit tests.. 
Back to top
Login to vote
Sean McBride

External


Since: Jan 05, 2004
Posts: 474



(Msg. 3) Posted: Sat Jan 19, 2008 12:15 am
Post subject: Re: [Q] Using OCUnit on Intel, how do I also run my unit tests under Rosetta? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
David Phillip Oster wrote:

> Extra credit: How about Intel-32, Intel-64, PowerPC-32, PowerPC-64?

Rosetta does not support ppc64, so you can only get 3 of 4 with a
current Mac as your dev machine.
 >> Stay informed about: [Q] Using OCUnit on Intel, how do I also run my unit tests.. 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 974



(Msg. 4) Posted: Sat Jan 19, 2008 8:33 am
Post subject: Re: [Q] Using OCUnit on Intel, how do I also run my unit tests under Rosetta? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
Sean McBride wrote:

> In article ,
> David Phillip Oster wrote:
>
> > Extra credit: How about Intel-32, Intel-64, PowerPC-32, PowerPC-64?
>
> Rosetta does not support ppc64, so you can only get 3 of 4 with a
> current Mac as your dev machine.

Yes, but for those three, if you set the architecture in your unit test
bundle's build settings, the default unit test target's RunUnitTest
build phase will already run Intel-32, Intel-64, PowerPC-32 versions of
the test without you having to take any further action.
 >> Stay informed about: [Q] Using OCUnit on Intel, how do I also run my unit tests.. 
Back to top
Login to vote
Sean McBride

External


Since: Jan 05, 2004
Posts: 474



(Msg. 5) Posted: Sat Jan 19, 2008 12:35 pm
Post subject: Re: [Q] Using OCUnit on Intel, how do I also run my unit tests under Rosetta? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
David Phillip Oster wrote:

> In article ,
> Sean McBride wrote:
>
> > In article ,
> > David Phillip Oster wrote:
> >
> > > Extra credit: How about Intel-32, Intel-64, PowerPC-32, PowerPC-64?
> >
> > Rosetta does not support ppc64, so you can only get 3 of 4 with a
> > current Mac as your dev machine.
>
> Yes, but for those three, if you set the architecture in your unit test
> bundle's build settings, the default unit test target's RunUnitTest
> build phase will already run Intel-32, Intel-64, PowerPC-32 versions of
> the test without you having to take any further action.

Yup! It's one of my favourite new features in Xcode 3.
 >> Stay informed about: [Q] Using OCUnit on Intel, how do I also run my unit tests.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
PPC -> INTEL - Hi all, how to replace this PPC G5 method "__cnldzw()" on futur intel 64 bits? i have this asm code >On PPro or newer processor you can count leading zeros this way: > static const int _31 = 31; > static const int _m1 = -1; >...

Intel Assembly on Mac - Hi, I have an arseignment that needs to be finished by tomorrow, an arseembly program for intel-architecture. It's quite simple (a scheduler), but, there is the problem that things are written to the screen. How can I make and test this assignment, using...

Java 1.5.0 JDK on Intel Mac - Hi, I just bought a Macbook Pro, and I'm interested in getting into Java development on the platform. I installed the Netbeans 5.0 IDE, and the only JDK it can find is 1.4.2. I'm told that the 5.0 libraries are on disk somewhere, but I haven't found..

More Info not showing Intel - Hi, My 10.4 Universal build is only showing PowerPC in the Finders More Info panel. What have I not done? (Xcode 2.2 and OS 10.4.3) Thanks, Paul

MTCoreAudio on Intel; does it work? - Hi, My project is using MTCoreAudio and works OK on PPC but:- inputDevice = [MTCoreAudioDevice defaultInputDevice]; returns nil on my Intel iMac. Does MTCoreAudio work on Intel? Thanks, Paul
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]