Boost logo

Boost-Build :

Subject: Re: [Boost-build] Unit tests and DLL hell
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2011-04-26 08:49:46


Joshua Boyce wrote:

> I'm currently using Boost.Build as my library's build system, and I'm using
> Boost.Test for the unit testing, however I've run into a problem with one of
> my tests. The library I'm trying to test has two binary dependencies, which
> I just 'install' (using the Boost.Build install rule) when I build my
> application, however I can't work out how to drop the DLLs alongside the
> unit tests binaries.
>
> I have tried adding them as dependencies using the 'project' rule, but that
> doesn't cause the files to be copied as part of the unit test build phase
> (it works for the install rule however when my application is built).
>
> Is there any way I can have Boost.Build copy over my dependencies to the
> unit test's binary dir before it is run? If I can't do this is renders a
> large portion of my library untestable using this system, as the DLLs are
> critical to its operation.

Did you try:

        unit-test whatever : whatever.cpp : <use>whatever-library-target ;

That should arrange for PATH to be propertyly set when 'whatever' is run,
without as much as copying DLLs.

- Volodya

-- 
Vladimir Prus
Mentor Graphics
+7 (812) 677-68-40

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