Boost logo

Boost-Build :

From: rclemley <rclemley_at_[hidden] (rclemley_at_[hidden])
Date: 2003-01-09 13:33:02


For unit testing we have unit test executables that
are built using production libraries.

The unit test executables create a file in the current
working directory called "tests.passed" if successful.
If unsuccessful, error messages are printed but no
file is created and non-zero returned to the execution

I want to create a rule such that 'all' depends
on 'tests.passed' and such that 'tests.passed' depends
on the test executable which is built from the libraries.

I would like to write a simple rule that takes a
target of tests.passed and a dependency of the
executable and simply run the executable.
I feel this should be simple but I think I'm having
problems getting the correct path to the executable.
I think my MakeLocate is somehow wrong:

my-test tests.passed : myprog ;

rule my-test ( test-output-file : dependency + )
local _t = [ FGristSourceFiles $(test-output-file) ] ;

MakeLocate $(dependency) : $(LOCATE_TARGET) ;
DEPENDS all : $(_t) ;
DEPENDS $(_t) : $(dependency) ;

COMMAND-LINE on $(dependency) = "" ;
Run $(dependency) ;

Another approach I've taken is to modify the unit-test rule
to add the dependencies for the test.passed file, the
problem is that a missing test.passed file does not
trigger the run of the test.

rule my-unit-test
local _t = [ FGristSourceFiles $(1) ] ;
local files = [ exe $(2) : $(3) : $(4) : $(5) ] ;
DEPENDS all : $(_t) ;
DEPENDS $(_t) : $(files) ;

COMMAND-LINE on $(files) = $(5) ;

for local file in $(files)
Run $(file) ;

Thank you,


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