Boost logo

Boost-Build :

Subject: Re: [Boost-build] Copy file to output directory
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-04-10 03:30:31


On Friday, April 08, 2011 23:28:39 sichent wrote:
> Ian,
>
> thanks I followed your recommendations and the file is being copied to
> the output directory... so i am facing another question now:
>
> how do you know inside your unit test from where to open the copied file?
>
> i tried to pass the name of the file through additional arguments to the
> [ run ... ] rule or just use hardcoded "file.txt" name but seems that
> working directory of unit test is where Jamfile is located and NOT the
> path where tests's binary is generated...

Hi,

you seem to be going a rather long-winded route. Can you just have this:

        run test.cpp : : input-file.txt ;

Then, you test.cpp will know it's own directory (in argv[0]) and the directory
where input-file.txt is.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

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