Boost logo

Boost-Build :

From: Matthew Herrmann (matthew.herrmann_at_[hidden])
Date: 2007-11-12 16:43:36


Hi All,

I'd like to ensure that unit tests are re-run when a library is rebuilt.
I'm trying to do it by making a wrapped target "tested lib", which
depends on the library (as a source), and on the unit test (using
<dependency>).

It seemed initially to work, but:
a) if I touch one file in the library, all files in the client must be
rebuilt (workable) and
b) properties of the unit test, such as linked libraries are undesirably
propagated to the client. For example, all executables start linking
against boost-test because it is used by the unit test.

If I try with <use> instead of <dependency> the dependency is ignored.
Is there any way to depend on a target without all of its properties
leaking into the dependent target?

Thanks in advance for any help,

Best Regards,
Matthew

=========
project dependency ;

using gcc : g++ ;

# library and test
lib first : a.cpp ;
alias second : : : : <include>justforunittest ;
exe first_unit_test : first second c.cpp ;
alias tested_first : first : : : <dependency>first_unit_test ;

# client
exe final : tested_first b.cpp ;

$ bjam final causes "justforunittest" is added as an include path to b's
compilation.
=================


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk