Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-11-09 15:32:33


"Vladimir Prus" <ghost_at_[hidden]> wrote in message
news:ej01q8$207$1_at_sea.gmane.org...
> Gennadiy Rozental wrote:
>
> Gennadiy Rozental wrote:
>
>>
>> "Juergen Hunold" <hunold_at_[hidden]> wrote in message
>> news:200611082043.27180.hunold_at_ivembh.de...
>>> > No. DLL Support is implemented. Boost.Test Jamfile is updated also
>>> > to support this
>>
>>> But not Jamfile.v2
>>
>> Yes. That's right. I know nothing about Boost.Build V2 and never
>> supported
>> second file.
>>
>>> Please find test_build.Jamfile.v2 attached for enabling shared linking
>>> using msvc and defining "BOOST_TEST_DYN_LINK=1" on all platforms for
>>> shared linking. This makes the behaviour consistant on all platforms
>>> which means you'll get similar errors on all platforms...
>>> And also adding the missing usage requierements without nothing will
>>> work at all :-))
>>
>> You also need to use <dll>... instead of <lib>.... I think
>
> Not in V2.
>
>>> > 1. What are the instructions for using Boost.Test DLL on Windows?
>>
>> Here are some extracts from docs I an working on:
>>
>> Building dynamic library
>> First let's clarify that by dynamic library here (and further in the
>> documentation) we mean dynamically loaded library (alternatively it's
>> also
>> called shared library). To build dynamic library you need to add
>> BOOST_TEST_DYN_LINK to the list of defines in makefile. Note that the
>> same
>> flag BOOST_TEST_DYN_LINK needs to be defined during test module
>> compilation for it to successfully link with dynamic library.
>
> ...
>
>> Dynamically build version on the UTF supplies the test runner in a form
>> of
>> free function unit_test_main with the following signature:
>>
>>
>>
>> int unit_test_main( bool (*init_unit_test_func)(), int argc, char* argv[]
>> );
>>
>>
>>
>> Unlike static library case, function main() implementation couldn't
>> reside
>> in a library code for portability reasons. Instead it's supplied as part
>> of unit_test.hpp header and included in case if BOOST_TEST_MAIN or
>> BOOST_TEST_MODULE flags are defined during compilation, while
>> BOOST_TEST_NO_MAIN is not. Notice that if multiple test files in test
>> module include unit_test.hpp, BOOST_TEST_MAIN/ BOOST_TEST_MODULE should
>> be
>> defined only in one of them.
>
> Does BOOST_INCLUDE_MAIN work as well?

No. I know nothing about BOOST_INCLUDE_MAIN.

> Also:
>
> 1. What about prg_exec_monitor? It's built as DLL by Jamfile, what are the
> usage conditions for it?

These were extracts from UTF docs. Check prg_exec_example_dll.vcproj for
example and check docs for Program Execution Monitor in cvs.

> 2. Why test_exec_monitor is provided only as static library?

This component is deprecated and I do not do further development for it.

>>> - can we provide a (maybe special) target which will automagically
>>> provide a "main" when linking to the shared libraries ?
>>
>>
>> Please read above and let me know if your questions still persist.
>
> It think the question is still reasonable. Can you have *static* library
> called unit_test_framework_main that would contain the stock definition of
> the 'main' function?

I am not sure I understand: static version of the UTF does have function
main() implementation included.

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk