|
Boost-Build : |
From: Jaroslav Gresula (jgresula_at_[hidden])
Date: 2006-02-15 10:47:23
Vladimir Prus <ghost <at> cs.msu.su> writes:
> Try this:
>
> import testing ;
> import feature ;
>
> rule set-env-var ( properties * )
> {
> local v = [ feature.get-values <variant> : $(properties) ] ;
> return <testing.launcher>MY_ENV_VAR=/some/dir/$(v) ;
> }
>
> unit-test a : a.cpp : <conditional> <at> set-env-var ;
>
> Running this, I get:
>
> testing.unit-test bin/gcc/debug/a.passed
>
> MY_ENV_VAR=/some/dir/debug bin/gcc/debug/a
> && touch bin/gcc/debug/a.passed
>
> which does the right effect on Unix. For windows you might need to use
> "set ..... &&" as the value of <testing.launcher>
Hi Vladimir,
I'm on a windows box and it seems that the "set ..... &&" approach does not work
as '&&' is discarded somewhere along the processing. Running it, I get:
set MY_ENV_VAR=/some/dir/debug _stage/a.exe && echo. > stage/a.passed
which makes _stage/a.exe part of the MY_ENV_VAR instead of running it.
For completness, here is my set-env-var rule:
rule set-env-var ( properties * )
{
local variant = [ feature.get-values <variant> : $(properties) ] ;
return <testing.launcher>"set MY_ENV_VAR=/some/dir/$(variant) &&" ;
}
Thanks,
Jarda.
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