Boost logo

Boost :

Subject: Re: [boost] [test] [build] best practices for looking up data files from test executables
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2017-11-13 20:56:02


On 13.11.2017 15:52, Peter Dimov via Boost wrote:
> Stefan Seefeld wrote:
>
>> Hi there,
>>
>> I'm trying to write a test that needs to access a data file. As I'm
>> surely not the first wanting to use external data in my tests, I
>> wonder whether there are established "best practices" or idioms when
>> using Boost.Build and Boost.Test.
>
> Use the "input files" parameter of the run rule.
>
> run my_test.cpp : : my_datafile.txt ;
>
> This will pass my_datafile.txt (with the correct path) to your test
> executable in argv[1].

But using boost::test I don't have direct access to argv, or do I ? I
don't get to write my own main() function...

>
> I just fixed the date_time tests in this manner:
>
> https://github.com/boostorg/date_time/commit/2434bc8f4d7e5d921eeccd4b138174eddd50d18c
>

Thanks,

Stefan

-- 
      ...ich hab' noch einen Koffer in Berlin...
    

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk