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.


|