def test(self): fpath = os.path.join( autoconfig.data_directory, 'already_exposed_to_be_exported.hpp' ) mb = module_builder.module_builder_t( [module_builder.create_source_fc( fpath )] , xml_generator_config=autoconfig.xml_generator_config ) mb.global_ns.exclude() mb.namespace( 'already_exposed' ).include() mb.build_code_creator( 'already_exposed' ) already_exposed_dir = os.path.join( autoconfig.build_directory, 'already_exposed' ) mb.write_module( os.path.join( already_exposed_dir, 'already_exposed.cpp' ) ) #----------------------------------------------------------------------- fpath = os.path.join( autoconfig.data_directory, 'already_exposed_2to_be_exported.hpp' ) mb = module_builder.module_builder_t( [module_builder.create_source_fc( fpath )] , xml_generator_config=autoconfig.xml_generator_config ) mb.global_ns.exclude() mb.namespace( 'to_be_exposed' ).include() mb.build_code_creator( 'to_be_exposed' ) mb.register_module_dependency( already_exposed_dir ) mb.build_code_creator( 'to_be_exposed' ) to_be_exposed_dir = os.path.join( autoconfig.build_directory, 'to_be_exposed' ) mb.write_module( os.path.join( to_be_exposed_dir, 'to_be_exposed.cpp' ) ) body = mb.code_creator.body self.assertTrue( 2 == len( body.creators ) ) ae_derived_code = body.creators[0].create() self.assertTrue( mb.class_( 'ae_base' ).decl_string in ae_derived_code )
def test(self): fpath = os.path.join( autoconfig.data_directory, 'already_exposed_to_be_exported.hpp' ) mb = module_builder.module_builder_t( [module_builder.create_source_fc( fpath )] , gccxml_path=autoconfig.gccxml.executable, compiler=pygccxml.utils.native_compiler.get_gccxml_compiler() ) mb.global_ns.exclude() mb.namespace( 'already_exposed' ).include() mb.build_code_creator( 'already_exposed' ) already_exposed_dir = os.path.join( autoconfig.build_directory, 'already_exposed' ) mb.write_module( os.path.join( already_exposed_dir, 'already_exposed.cpp' ) ) #----------------------------------------------------------------------- fpath = os.path.join( autoconfig.data_directory, 'already_exposed_2to_be_exported.hpp' ) mb = module_builder.module_builder_t( [module_builder.create_source_fc( fpath )] , gccxml_path=autoconfig.gccxml.executable , compiler=pygccxml.utils.native_compiler.get_gccxml_compiler() ) mb.global_ns.exclude() mb.namespace( 'to_be_exposed' ).include() mb.build_code_creator( 'to_be_exposed' ) mb.register_module_dependency( already_exposed_dir ) mb.build_code_creator( 'to_be_exposed' ) to_be_exposed_dir = os.path.join( autoconfig.build_directory, 'to_be_exposed' ) mb.write_module( os.path.join( to_be_exposed_dir, 'to_be_exposed.cpp' ) ) body = mb.code_creator.body self.failUnless( 2 == len( body.creators ) ) ae_derived_code = body.creators[0].create() self.failUnless( mb.class_( 'ae_base' ).decl_string in ae_derived_code )
def test(self): fpath = os.path.join(autoconfig.data_directory, 'already_exposed_to_be_exported.hpp') mb = module_builder.module_builder_t( [module_builder.create_source_fc(fpath)], gccxml_path=autoconfig.gccxml.executable, compiler=pygccxml.utils.native_compiler.get_gccxml_compiler()) mb.global_ns.exclude() mb.namespace('already_exposed').include() mb.build_code_creator('already_exposed') already_exposed_dir = os.path.join(autoconfig.build_directory, 'already_exposed') mb.write_module( os.path.join(already_exposed_dir, 'already_exposed.cpp')) #----------------------------------------------------------------------- fpath = os.path.join(autoconfig.data_directory, 'already_exposed_2to_be_exported.hpp') mb = module_builder.module_builder_t( [module_builder.create_source_fc(fpath)], gccxml_path=autoconfig.gccxml.executable, compiler=pygccxml.utils.native_compiler.get_gccxml_compiler()) mb.global_ns.exclude() mb.namespace('to_be_exposed').include() mb.build_code_creator('to_be_exposed') mb.register_module_dependency(already_exposed_dir) mb.build_code_creator('to_be_exposed') to_be_exposed_dir = os.path.join(autoconfig.build_directory, 'to_be_exposed') mb.write_module(os.path.join(to_be_exposed_dir, 'to_be_exposed.cpp')) body = mb.code_creator.body self.failUnless(2 == len(body.creators)) ae_derived_code = body.creators[0].create() self.failUnless(mb.class_('ae_base').decl_string in ae_derived_code)
def test(self): exposed_db = utils.exposed_decls_db_t() fpath = os.path.join( autoconfig.data_directory, 'already_exposed_to_be_exported.hpp' ) mb = module_builder.module_builder_t( [module_builder.create_source_fc( fpath )] , gccxml_path=autoconfig.gccxml.executable ) mb.global_ns.exclude() mb.namespace( 'already_exposed' ).include() exposed_db.register_decls( mb.global_ns ) exposed_db.save( autoconfig.build_dir ) mb.register_module_dependency( autoconfig.build_dir ) mb.class_( 'ae_derived' ).include() mb.build_code_creator( 'xxx' ) body = mb.code_creator.body self.failUnless( 1 == len( body.creators ) ) ae_derived_code = body.creators[0].create() self.failUnless( mb.class_( 'ae_base' ).decl_string in ae_derived_code )