[C++-sig] Running Py++ unittests using mb.split_module()
Haridev, Meghana
mharidev at qualcomm.com
Thu Mar 1 01:39:34 CET 2007
Hi Folke,
This is regarding the Py++ unittests:
Currently all the tests (except for the split_module_* tests) are run
such that all the Py++ generated boost.python bindings are written to a
single file (using mb.write_module in
fundamental_tester_base_t.generate_source_files() ).
Regarding our development environment, we always invoke Py++ to write to
multiple files (using mb.split_module). I plan to test the sanity of
some internal patches that I made to Py++ file_writer: multiple_files.py
by running them against the Py++ unittests (by writing the bindings to
multiple files). So I modified
fundamental_tester_base_t.generate_source_files() and
fundamental_tester_base_t.get_source_files() appropriately, and use a
flag defined in autoconfig.py to switch from using "single file" to
"multiple file" generation. Most of the tests pass, but some tests fail
with linking errors due to "multiple definitions" when I generate code
to multiple files.
For example, abstract_tester fails with the following error:
square.pypp.os: In function `abstract::call(abstract::shape*)':
square.pypp.cpp:(.text+0x0): multiple definition of
`abstract::call(abstract::shape*)'
shape.pypp.os:shape.pypp.cpp:(.text+0x0): first defined here
abstract_enumerations.pypp.os: In function
`abstract::call(abstract::shape*)':
abstract_enumerations.pypp.cpp:(.text+0x0): multiple definition of
`abstract::call(abstract::shape*)'
shape.pypp.os:shape.pypp.cpp:(.text+0x0): first defined here
abstract_free_functions.pypp.os: In function
`abstract::call(abstract::shape*)':
abstract_free_functions.pypp.cpp:(.text+0x0): multiple definition of
`abstract::call(abstract::shape*)'
shape.pypp.os:shape.pypp.cpp:(.text+0x0): first defined here
abstract.main.os: In function `abstract::call(abstract::shape*)':
abstract.main.cpp:(.text+0x0): multiple definition of
`abstract::call(abstract::shape*)'
shape.pypp.os:shape.pypp.cpp:(.text+0x0): first defined here
collect2: ld returned 1 exit status
scons: *** [abstract.so] Error 1
Some of the other tests that fail due to "multiple definitions" are:
- free_operators_tester
- special_operators_tester
- temporary_variable_tester
- unnamed_classes_tester
- overloads_macro_tester
I know that this can be resolved by splitting the associated "data"
files to separate .hpp and .cpp files. I was wondering if anybody had
tried running the Py++ unittests for multiple generated files? I think
it would be a good idea to split these data files into .hpp and .cpp
files so that we can switch between testing for "single file" and
"multiple file" generation seamlessly.
Thanks,
-Meghana.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070228/b394db27/attachment.htm>
More information about the Cplusplus-sig
mailing list