|
Boost-Build : |
Subject: Re: [Boost-build] "run" rule with same binary but different parameters
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2016-10-10 03:46:33
Le 10/10/16 à 02:26, Steven Watanabe a écrit :
> AMDG
>
> On 10/09/2016 05:10 PM, Raffi Enficiaud wrote:
>>
>> I am trying to run a binary with different command line parameters, so
>> right now I have this:
>>
>> [ run smoke-ts/basic-smoke-test.cpp
>> ../build//boost_unit_test_framework/<link>static :
>> --log_sink=smoke-ts-sink.xml --log_format=XML ]
>> [ run smoke-ts/basic-smoke-test.cpp
>> ../build//boost_unit_test_framework/<link>static :
>> --log_sink=smoke-ts-sink2.xml --log_format=HRF : : : bt-st-b2 ]
>>
>> This works ok, but requires the recompilation of the same sources. If I
>> omit the ": : : bt-st-b2", b2 is confused as apparently it does not
>> support the same target name.
>>
>> Is there a way to do that without being forced to recompile?
>>
>
> Build an exe target and pass it to run.
> (I think there's a bug that will cause
> this to fail with preserve-test-targets=off,
> though).
>
> In Christ,
> Steven Watanabe
>
Thank you Steven and Edward! This works:
alias "smoke-ts"
:
[ exe smoke-ts-static : smoke-ts/basic-smoke-test.cpp
../build//boost_unit_test_framework/<link>static ]
[ run smoke-ts-static : --log_sink=smoke-ts-sink.xml --log_format=XML
: : : bt-st-t1 ]
[ run smoke-ts-static : --log_sink=smoke-ts-sink2.xml
--log_format=HRF : : : bt-st-t2 ]
;
exactly as I expect (build the binary and then test it with different
options).
However, if I add
[ exe smoke-ts-shared : smoke-ts/basic-smoke-test.cpp
../build//boost_unit_test_framework/<link>shared ]
[ run smoke-ts-shared : --log_sink=smoke-ts-sink.xml --log_format=XML
: : : bt-sh-t1 ]
I run into a conflict because "basic-smoke-test.cpp" is compiled with
two different set of options while reusing the same obj.
Can I specify not reusing the same obj?
Thanks again for the quick support,
Raffi
PS: I am a complete novice when it comes to b2
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