Boost logo

Boost-Build :

Subject: [Boost-build] Copying / referring to a test data file.
From: Justin Muncaster (jmuncaster_at_[hidden])
Date: 2010-04-23 13:09:52


Hello,

I am writing a unit-test which requires test data. I'm having a hard time
creating a good setup under which the test data file can be easily
referenced from my main source. The project hierarchy is:

/Project
|-Jamroot
|-/Subproject
    |- test-main.cpp
    |- test-data1.txt
    |- test-data2.txt
    |- Jamfile

Jamroot simply consists of "build-project Subproject ;"

Jamfile consists of
  import testing ;
  unit-test test-main : test-main.cpp ;

test-main.cpp opens the data file "test-data1.txt". If I build in the
Subproject directory, this file is found and everything works, but if I
build from the Project directory, then test-data.txt is not found.

Ultimately, I would like to somehow have test-data#.txt in the "sources" or
in some other target on which the test-main target depends, and have the
data files be copied-to or symlinked-from the location of the executable...
but I am unclear on how to accomplish this. Any suggestions?

Thank you,

Justin Muncaster


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