I just added this simple definition to PyBindGen's unit tests:
std::map<std::string, int> get_map ();
Afterwards, pygccxml (0.9.5) just enters what appears to be an inifinite
loop when I call container_traits.element_type().
Traceback (most recent call last):
File "../tests/foomodulegen-auto.py", line 51, in <module>
main()
File "../tests/foomodulegen-auto.py", line 48, in main
profile.run('my_module_gen()', 'foomodulegen-auto.pstat')
File "/usr/lib/python2.5/cProfile.py", line 29, in run
prof = prof.run(statement)
File "/usr/lib/python2.5/cProfile.py", line 135, in run
return self.runctx(cmd, dict, dict)
File "/usr/lib/python2.5/cProfile.py", line 140, in runctx
exec cmd in globals, locals
File "<string>", line 1, in <module>
File "../tests/foomodulegen-auto.py", line 27, in my_module_gen
gccxml_options=gccxml_options)
File "/home/gjc/projects/pybindgen/trunk/pybindgen/gccxmlparser.py", line
599, in parse
self.scan_types()
File "/home/gjc/projects/pybindgen/trunk/pybindgen/gccxmlparser.py", line
778, in scan_types
self._scan_namespace_types(self.module, self.module_namespace,
pygen_register_function_name="register_types")
File "/home/gjc/projects/pybindgen/trunk/pybindgen/gccxmlparser.py", line
1194, in _scan_namespace_types
self._register_container(module, traits, type_info, _outer_class, name)
File "/home/gjc/projects/pybindgen/trunk/pybindgen/gccxmlparser.py", line
1313, in _register_container
element_type = traits.element_type(definition)
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/container_traits.py",
line 345, in element_type
return xxx_traits.impl.element_type( type )
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/container_traits.py",
line 309, in element_type
ref = type_traits.impl_details.find_value_type( cls.top_parent,
value_type_str )
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/type_traits.py",
line 1034, in find_value_type
, allow_empty=True )
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/scopedef.py",
line 385, in decls
, allow_empty=allow_empty)
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/scopedef.py",
line 357, in _find_multiple
found = matcher_module.matcher.find( matcher, decls, False )
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/matcher.py",
line 49, in find
return filter( decl_matcher, where )
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/scopedef.py",
line 289, in <lambda>
return lambda decl: matcher( decl ) and keywds['function'](decl)
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/matchers.py",
line 210, in __call__
if not self.check_name( decl ):
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/matchers.py",
line 240, in check_name
and self.name != algorithm.full_name( decl, with_defaults=False ):
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/algorithm.py",
line 100, in full_name
return decl.cache.full_partial_name
File
"/usr/local//lib/python2.5/site-packages/pygccxml/declarations/algorithms_cache.py",
line 42, in _get_full_partial_name
def _get_full_partial_name( self ):
KeyboardInterrupt
Additionally, I have to ask, how to run unit tests in pygccxml? I found no
instructions, and the obvious does not seem to work:
gjc@dark-tower:unittests$ python test_all.py
compiler: __GCCXML_09__
unittests will run on DEVELOPMENT version
Traceback (most recent call last):
File "test_all.py", line 119, in <module>
print run_suite()
File "test_all.py", line 110, in run_suite
result = unittest.TextTestRunner(verbosity=2).run( create_suite() )
File "test_all.py", line 106, in create_suite
main_suite.addTest( tester.create_suite() )
File
"/home/gjc/projects/pygccxml_dev/unittests/start_with_declarations_tester.py",
line 48, in create_suite
suite.addTest( unittest.makeSuite(tester_t))
File "/usr/lib/python2.5/unittest.py", line 602, in makeSuite
return _makeLoader(prefix, sortUsing,
suiteClass).loadTestsFromTestCase(testCaseClass)
File "/usr/lib/python2.5/unittest.py", line 507, in loadTestsFromTestCase
return self.suiteClass(map(testCaseClass, testCaseNames))
File
"/home/gjc/projects/pygccxml_dev/unittests/start_with_declarations_tester.py",
line 19, in __init__
self.config = autoconfig.cxx_parsers_cfg.gccxml.clone()
AttributeError: 'NoneType' object has no attribute 'clone'
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
|