Boost logo

Boost Users :

Subject: Re: [Boost-users] [Test] BOOST_TEST_NO_MAIN with pre-built BoostPro libraries
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2009-08-08 13:55:06


Alexander Lamaison <awl03 <at> doc.ic.ac.uk> writes:

>
> Is it possible to create one's own main() implementation when using
> the pre-built Boost libraries from BoostPro?

Yes. If you use shared library.

> The difficulty seems to be that, even if I define BOOST_TEST_NO_MAIN
> before including unit_test.hpp, the main method still exists in the
> pre-built library and this causes a linker conflict. The existing

You can't after the fact (after the library is built) change the symbols which
are present there.

> code I'm wokring on specifies /FORCE to the linker to make our main
> override the library main but I think that's a horrible solution and
> would really like to try something else.

hmm. I wasn't aware about this option.
 
> Even better would be if there were a way to only invoke our code,
> which includes calls to framework::run(test), if a particular
> command-line argument were present. In all other cases it would be
> nice to have the default test runner behaviour. I think this may be
> wishful thinking though.

As I said. Using shared library you shaould be able to get what you want here.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net