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-10 05:27:17


Le 10/10/16 à 10:44, Raffi Enficiaud a écrit :
> Hi again :)
>
> I would like to have a simple rule
>
> """
> run smoke-ts-static : --log_sink=smoke-ts-sink.xml --log_format=XML : :
> : some-target-name-0
> """
>
> but I would like the output file "smoke-ts-sink.xml" to be located in
> the same directory containing the other outputs (.output, .run and .test) .
>
> There is a build-dir property
>
> http://www.boost.org/doc/libs/1_62_0/doc/html/bbv2/reference.html#bbv2.reference.class.project-target.build-dir
>
>
> but I have two questions related to that:
>
> 1. How do I use it? :)
>
> I declare things like this
> to-return =
> [ 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.$(logger)
> --log_format=$(logger) : : : $(test-name-prefix)-2 ]
>
> but then, when I do
> ECHO $(test-name-prefix)-2 ;
> ECHO $($(test-name-prefix)-2).name ;
> ECHO $($(test-name-prefix)-2).build-dir ;
> #ECHO $(test-name-prefix)-2.build-dir ( ) ;
>
> I have nothing except for the $(test-name-prefix)-2 giving the right value.
>
> 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
>
> or "$(some-target-name-0).build-dir" is expanded at the calling point
> and yields to an undefined value?
>
> Thanks!
> Raffi

A little more on this, the following yields a segmentation fault:

rule boost.test-smoke-ts-logger ( test-name-prefix : logger ? )
{
     logger ?= HRF ;

     to-return =
       [ run smoke-ts-static : --log_format=$(logger) : : :
$(test-name-prefix)-0 ]
       [ run smoke-ts-static : --log_format=$(logger) --log_level=all :
: : $(test-name-prefix)-1 ]
       [ run smoke-ts-static : --log_sink=smoke-ts-sink.$(logger)
--log_format=$(logger) : : : $(test-name-prefix)-2 ]
       [ run smoke-ts-static : --log_sink=smoke-ts-sink.$(logger)
--log_format=$(logger) --log_level=all : : : $(test-name-prefix)-3 ]
    ;

    ECHO [ $(to-return[0]).name ] ; # works
    ECHO [ $($(test-name-prefix)-0).name ] ; # does not work
    ECHO [ $(to-return[0]).build-dir ] ; # segmentation fault here
    return $(to-return) ;
}

Any hints more than welcome,
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