Re: [test] How do you create test cases in a DLL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [test] How do you create test cases in a DLL

Stewart Tootill
This may not help, and may not be the right way to go about it, but typically I get around this by putting all of the internal bits into a static lib, then linking that into the test binary. This also means that when I link the DLL, the test bits are left out, so I don't have to ship alot of redundant test code which the unused testInternals export would cause to be included in the final DLL. Admitedly, my DLLs are designed to be built in this way..
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of Mark Snelling
Sent: 12 January 2006 17:53
To: [hidden email]
Subject: [Boost-users] [test] How do you create test cases in a DLL

I have some internal (non-exported) classes in a DLL that I want to test. I'm trying to do this by exporting a testInternals() function that my tester application will add to it's test suite.

The problem I'm having is that to use any of the BOOST_CHECK_??? etc macros I have to include the <boost/test/test_tools.hpp> file. This causes undefined symbol linker errors.

Is there a way to do what I want to do?

________________________________________________________________________
This e-mail has been scanned for viruses by MessageLabs.

________________________________________________________________________
This e-mail has been scanned for viruses by MessageLabs.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [test] How do you create test cases in a DLL

Gennadiy Rozental
> I have some internal (non-exported) classes in a DLL that I want to test.
> I'm trying to do
> this by exporting a testInternals() function that my tester application
> will add to it's test suite.
>
> The problem I'm having is that to use any of the BOOST_CHECK_??? etc
> macros
> I have to include the <boost/test/test_tools.hpp> file. This causes
> undefined symbol
> linker errors.
>
> Is there a way to do what I want to do?

This scenario is not supported by Boost.Test 1.33.1. But it is supported by
current CVS version. Moreover - there is new tool called boost_test_runner
that you could use to perform the testing:

boost_test_runner -test <library_name> [-init <init_func_name>]

Gennadiy



_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users