Boost logo

Boost-Build :

Subject: [Boost-build] how to pull in defs from __init.py__ in jamfiles?
From: Avi Bahra (avibahra_at_[hidden])
Date: 2010-07-17 11:34:08


I am experimenting with boost python, and am using the
the run-test function in the jam file.
However I cant get my python tests to read the common
definitions declared in my python extensions __init.py__ file

At the moment I am working round the problem, by coping and pasting
the common code into each of my python tests.

I have the following directory structure:

Pyext
   src
       // cpp and header files for python extension called _ecf

   ecf
       __init.py__

   test
       TestClient.py // python test files

I want my python test file to be able to access the common
functions defined in ecf/__init.py__.

My Jamfile look like:
......
local rule run-test ( test-name : sources + )
{
    testing.make-test run-pyd : $(sources) : : $(test-name) ;
}

# Declare test targets
run-test TestClient : _ecf [ glob test/TestClient.py ] ;
.....

In order to pull in the __init.py__ i tried:

run-test TestClient : _ecf [ glob test/TestClient.py ] [ glob
ecf/__init.py__ ] ;

but this lead to the following error:

/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build/generators.jam:1113: in
ensure-type from module generators
error: target { ecf/__init.py__. } has no type
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build/generators.jam:1347: in
generators.construct from module generators
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build/targets.jam:1495: in
construct from module object(typed-target)@181
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build/targets.jam:1297: in
object(typed-target)@181.generate from module object(typed-target)@181
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build/targets.jam:732: in
generate-really from module object(main-target)@690
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build/targets.jam:704: in
object(main-target)@690.generate from module object(main-target)@690
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/build-system.jam:735: in load
from module build-system
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/kernel/modules.jam:283: in
import from module modules
/var/tmp/ma0/boost/boost_1_42_0/tools/build/v2/kernel/bootstrap.jam:142: in
boost-build from module
/var/tmp/ma0/clientRoot/workspace/MyProject/boost-build.jam:18: in module
scope from module

I tried other variation but all to no-avail.
Any help appreciated.

   Best regards,
Ta,
    Avi



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