In article
<3448120c-c6fb-4475-981b-96d5e1dbd8da@[EMAIL PROTECTED]
>,
Jason8 <jason.leach@[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


|