Talk About Network

Google





Mac > Mac Programmer Tools > Re: Unit Testin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 628 of 637
Post > Topic >>

Re: Unit Testing a Library

by Jason8 <jason.leach@[EMAIL PROTECTED] > Jun 27, 2008 at 07:16 PM

On Jun 26, 11:40=A0pm, David Phillip Oster <os...@[EMAIL PROTECTED]
> wrote:
> In article
> <3448120c-c6fb-4475-981b-96d5e1dbd...@[EMAIL PROTECTED]
>,
>
> =A0Jason8 <jason.le...@[EMAIL PROTECTED]
> wrote:
> > Hi:
>
> > I've made a C++ library and would like to develop some unit test for
> > it. Do I need to make an executable to use unit tests or can I write
> > them against my dylib?
>
> > Also, what does it mean in the tutorial (http://developer.apple.com/
> > do***entation/DeveloperTools/Conceptual/UnitTesting/Articles/
> > CreatingTests.html#//apple_ref/doc/uid/TP40002171-122120) when it says
> > I need to register my tests? I suppose this depends on the answer to
> > my question above.
>
> > Thanks.
>
> You can't run tests without a program to run them. For a C++ library,
> you make a second target in the project, with a main, that links against
> your library.
>
> If you read the link you reference above, it actually gives an example
> of registering your tests. quote:
>
> MyTests test1(TEST_INVOCATION(MyTests, MyFirstTest));
>
> MyTests test2(TEST_INVOCATION(MyTests, MySecondTest));
>
> A related example, but an Objective-C library, with unit tests, is
> available at:http://code.google.com/p/google-toolbox-for-mac

Hi: I saw the registration comment. And I don't understand a few
things about it. First the tutorial implies that test1() will contain
my test code, however the definition above implies MyFirstTest will be
executed and run my test code. I'd like to better understand the
difference and where exactly the method bodies should reside.

Second, I'm not sure where to place that registration information. For
example do I paste it into the body of executable we determined I need
(in main) or do I put it above outside of main so it's global.
 




 3 Posts in Topic:
Unit Testing a Library
Jason8 <jason.leach@[E  2008-06-26 19:39:56 
Re: Unit Testing a Library
David Phillip Oster <o  2008-06-26 23:40:41 
Re: Unit Testing a Library
Jason8 <jason.leach@[E  2008-06-27 19:16:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 22:54:30 PST 2009.