Subject: Re: [Boost-build] Idiom for running tests using (non-test) target?
From: Mat Marcus (mat-lists_at_[hidden])
Date: 2008-10-24 20:30:33
On Fri, Oct 24, 2008 at 3:08 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> Mat Marcus wrote:
>> I use boost build to build a set of libraries and tools which use
>> those libraries. After tool "foo" is built, I'd like to run some tests
>> with it, as part of the build process. It would not be convenient to
>> use the run rule and --preserve-targets, since the tool "foo" is part
>> of the user distribution. Is there a good idiom for running tests, as
>> part of the build, with a "first class" build target? In case it
>> matters, this tool can be used as a translator, accepting files with
>> one extension and producing files with another.
> It works as long as you specify a name for the target.
> exe a : a.cpp ;
> run a : : : : a_test ;
> In Christ,
> Steven Watanabe
Thanks, this is a helpful start. Now, when I build the "exe" target,
the executable builds as expected. But when I run the test, the
executable gets deleted, even it was built earlier. I'd like to be
able to invoke bjam a single time, without having to pass
--preserve-test-targets, so that the test is run *and* the executable
is preserved. Is this possible? Put another way, can the run rule make
use of an existing artifact without deleting it, without having to
pass options to bjam?
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