Boost logo

Boost-Build :

Subject: Re: [Boost-build] [run] parameter containing the build directory - segmentation fault
From: Raffi Enficiaud (raffi.enficiaud_at_[hidden])
Date: 2016-10-16 17:00:37


Le 10/10/16 à 16:47, Steven Watanabe a écrit :
> AMDG
>
> On 10/10/2016 08:29 AM, Raffi Enficiaud wrote:
>>
>> This is also what I understood. However when the "[run ] " is executed,
>> the outputs are put to some folder, and I am interested in that folder.
>>
>
> You can't get the target folder at the top-level,
> in the Jamfile, since it isn't determined at that
> point. (There might even be more than one folder,
> if you are building multiple configurations)
>
>> Also, I go back to the 2nd question of my original post:
>>
>> """
>> 2. is it possible to have those properties on the same declaration as
>> the target itself? Something like
>> run smoke-ts-static :
>> --log_sink=$(some-target-name-0).build-dir/smoke-ts-sink.xml
>> --log_format=XML : : : some-target-name-0
>> """
>>
>> From what I understand, [run ] is creating a new target (I can have
>> "ECHO [ $(to-return[1]).name ]" ) and its name is "some-target-name-0".
>>
>> Is is possible to extract some properties on the target at the location
>> where [run ] is called? (something like lasy evaluation of the parameters)?
>>
>
> I think the easiest way is to use a conditional:
>
> rule set-sink ( properties * )
> {
> local ps = [ property-set.create $(properties) ] ;
> local path = [ $(ps).target-path ] ;
> return <testing.arg>--log-sink=$(path)/smoke-ts-sink.xml
> <testing.arg>--log-format=XML ;
> }
>
> Then, you can use <conditional>@set-sink in
> the requirements of the test case.
>
> In Christ,
> Steven Watanabe

Hi,

I tested several things, and I am quite not there yet.
The value here in path gets expanded to eg. "clang-darwin-4.2.1/debug"
while what I need is the same as the "testing.capture-output" line
which indicates
"../../../bin.v2/libs/test/test/bt-st-txml-0.test/clang-darwin-4.2.1/debug/bt-st-txml-0.run".

I also make the assumption that the tests are run from the current
directory.
 From your snipet, I just changed to

local path,relative-to-build-dir = [ $(ps).target-path ] ;

and declared the run as

[ run smoke-ts-static : : : <conditional>@set-sink : $(test-name-prefix)-0 ]

Now I have also some other questions related to that:

- I tried to make "set-sink" dependent of other variables, such that I
can expand the variables for the final "<testing.arg>", however I was
not able to do so.

   - is the "rule set-sink ( properties * )" the signature for
conditionals? or can I add another parameter?

   - can I have a rule returning a local rule and can a local rule
capture local variables? I tried this

rule set-sink-outter ( logger )
{
   rule set-sink-inner ( properties * )
   {
     local ps = [ property-set.create $(properties) ] ;
     local path,relative-to-build-dir = [ $(ps).target-path ] ;
     return <testing.arg>--log-sink=$(path)/smoke-ts-sink.$(logger)
            <testing.arg>--log-format=$(logger) ;
   }

   return <conditional>@set-sink-inner ;
}

and called the run like this
[ run smoke-ts-static : : : [ set-sink-outter XML ] :
$(test-name-prefix)-0 ]

but could not make it work. Any suggestion?

- I understand "<conditional>@set-sink" as a "pointer to set-sink
function". Is that correct?
- by parsing some other Jam files in boost, I also saw
"<conditional>%something". What would the "%" mean?

Thanks for the help,
Raffi


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