Boost logo

Boost-Build :

Subject: Re: [Boost-build] Jamfiles for unit tests
From: Boris Schaeling (boris_at_[hidden])
Date: 2009-10-15 14:57:51

On Thu, 15 Oct 2009 19:55:20 +0200, Steven Watanabe <watanabesj_at_[hidden]>

> [...]
>> ----------
>> import boost ;
>> import testing ;
>> boost.use-project ;
>> project : requirements <library>/boost//test ;
>> unit-test mytest : mytest.cpp ;
>> ----------
>> The linker (MSVC) complains it can't find the library (eg.
>> libboost_test-vc90-mt-gd-1_39.lib). There seems to be something wrong
>> with the target /boost//test (it exists but wrong files are looked up).
> Try adding <define>BOOST_ALL_NO_LIB to the project requirements.

It doesn't help. As far as I can tell it's not a problem with auto-linking
really. If I add a few more references to other Boost libraries and run
'bjam -n' I see that the linker is looking for these files (for example):


All the files exist except libboost_test-vc90-mt-gd-1_39.lib. The file is
actually called libboost_unit_test_framework-vc90-mt-gd-1_39.lib. It
doesn't matter either if I create debug or release versions or link
statically or dynamically. Everytime a file boost_test... is looked up
while it should be boost_unit_test_framework...

If I remove <library>/boost//test and add
<linkflags>libboost_unit_test_framework-vc90-mt-gd-1_39.lib it all works
again. But I would prefer a toolset-independent Jamfile.

This looks like a bug in the Jamfiles of Boost.Test to me. Can I overwrite
the basename of a library in my Jamfile to make Boost.Build look up
boost_unit_test_framework... and not boost_test...?

> [...]You don't need test-suite. The preferred way to write tests is
> run mytest.cpp ;

Thanks, I'll forget unit-test and test-suite. :)


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at