Boost logo

Boost-Build :

From: Zbynek Winkler (zwin_at_[hidden])
Date: 2004-03-29 11:56:34


Vladimir Prus wrote:
>>PS. Even rule my-test visible in all Jamfiles would be enough...
>>rule my-test ( name : sources * )
>>{
>> unit-test $(name) : $(sources) /site-config//cppunit /util//testMain ;
>>}
>
>
> Oh, that's even simpler. Put the above code in project-root.jam and then add
>
> IMPORT $(__name__) : my-test : : my-test ;
>
> after the rule definition. That would bring the rule to global module where
> everybody can access it.

I did that but I am getting a cryptic error message (see the attachements).
When the rule is in the Jamfile it can be used without a problem.

Zbynek

-- 
http://zw.matfyz.cz/ http://robotika.cz/
Faculty of Mathematics and Physics, Charles University, Prague, Czech Republic
 --------------080402030705090400020009 Content-Type: text/plain;
name="Jamfile"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Jamfile"
my-test : test.cpp ;
 --------------080402030705090400020009 Content-Type: text/plain;
name="project-root.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="project-root.jam"
using testing ;
rule my-test ( name ? : sources + )
{
name ?= test ;
unit-test $(name) : $(sources) /site-config//cppunit /util//testMain ;
}
IMPORT $(__name__) : my-test : : my-test ;
 --------------080402030705090400020009 Content-Type: text/plain;
name="test.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="test.cpp"

d:/software/boost-build-cvs/v2/build\project.jam:494: in project.attribute
warning: rulename $($(project).attributes).get expands to empty string
d:/software/boost-build-cvs/v2/build\targets.jam:1110: in targets.main-target-requirements
d:/software/boost-build-cvs/v2/build\targets.jam:1182: in targets.create-typed-target
d:/software/boost-build-cvs/v2/build\type.jam:291: in unit-test
project-root.jam:6: in my-test
Jamfile:1: in modules.load
d:/software/boost-build-cvs/v2/build\project.jam:255: in load-jamfile
d:/software/boost-build-cvs/v2/build\project.jam:67: in project.load
d:/software/boost-build-cvs/v2\build-system.jam:75: in load
d:\software\boost-build-cvs\v2\kernel\modules.jam:259: in import
d:\software\boost-build-cvs\v2\kernel\bootstrap.jam:120: in boost-build
d:\software\boost-build-cvs\v2\boost-build.jam:2: in module scope
d:/software/boost-build-cvs/v2/build\targets.jam:1111: in targets.main-target-requirements
*** argument error
* rule property.translate-paths ( properties * : path )
* called with: ( : )
* missing argument path
d:/software/boost-build-cvs/v2/build\property.jam:352:see definition of rule 'translate-paths' being called
d:/software/boost-build-cvs/v2/build\targets.jam:1182: in targets.create-typed-target
d:/software/boost-build-cvs/v2/build\type.jam:291: in unit-test
project-root.jam:6: in my-test
Jamfile:1: in modules.load
d:/software/boost-build-cvs/v2/build\project.jam:255: in load-jamfile
d:/software/boost-build-cvs/v2/build\project.jam:67: in project.load
d:/software/boost-build-cvs/v2\build-system.jam:75: in load
d:\software\boost-build-cvs\v2\kernel\modules.jam:259: in import
d:\software\boost-build-cvs\v2\kernel\bootstrap.jam:120: in boost-build
d:\software\boost-build-cvs\v2\boost-build.jam:2: in module scope
 --------------080402030705090400020009--


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