Boost logo

Boost Users :

Subject: Re: [Boost-users] path of test-binary
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-02-19 15:43:11


AMDG

On 01/28/2014 01:21 AM, dib wrote:
>
> # our test lib for shared library tests
> lib test_library : test_library.cpp ;
>
> <snip>
> [ run shared_library_load_test.cpp ]
> [ run shared_library_get_symbol_test.cpp ]
> <snip>
>
> Inside shared_library_*_test.cpp I need something like this:
> boost::filesystem::path
> tstlib("bin.v2/libs/mylib/test/mycompiler/test_library.so");
>
> As boost.build decides by itself where to put the binary, i cannot
> hardcode the path in the source-files.. Is there a way to get the path
> from boost.build? If not, how could I solve this problem?
>

The run rule is declared as:

rule run ( sources + : args * : input-files * : requirements * :
target-name ? : default-build * )

You'll want to pass the target in input-files:

run shared_library_load_test.cpp : : test_library ;

This will add the path to test_library to the
command line arguments when the test is run.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net