Boost logo

Boost-Build :

Subject: [Boost-build] run versus unit-test
From: Ian Emmons (iemmons_at_[hidden])
Date: 2009-05-13 16:52:46


I have seen numerous recommendation in this list to switch from using
the unit-test target to the newer "run" target. So I tried to do
that, but ran into a roadblock. Here is an abbreviated version of my
Jamfile (before the switch):

unit-test FooTest
    : [ glob *.cpp ]
       /site-config//BoostUnitTest
    : <include>.
       <dependency>config.txt
    ;

explicit config.txt ;
make config.txt : $(FooProjectDir)/config.txt : @common.copy ;

The key item of note here is that the unit test executable requires
the presence of config.txt in the same directory as the executable in
order to run properly. I have arranged for this by adding a
dependency to the unit-test target that copies the requisite file.
This works perfectly.

When I switch to the equivalent run target, the target that copies the
file does exactly what it did before, namely copy the file from the
project directory into a location like this:

    ...\Foo\msvc-9.0\debug\address-model-64\threading-multi

But the run rule does not build the executable in this same
directory. Instead, it builds here:

    ...\Foo\Foo.test\msvc-9.0\debug\address-model-64\threading-multi

Of course, the requisite config.txt file is not present in that
directory, so my tests fail.

So, I need to do one of two things. I either need to get the run
target to build in the usual place, or I need to copy the config.txt
file into the place that run uses to build. Either way, I don't see
how to do it. Any suggestions?

Thanks in advance,

Ian



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