From: Matthew Herrmann (matthew.herrmann_at_[hidden])
Date: 2007-11-12 16:43:36
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
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,
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 ;
exe final : tested_first b.cpp ;
$ bjam final causes "justforunittest" is added as an include path to b's
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