[pygccxml-commit] SF.net SVN: pygccxml:[1575] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-01-15 07:06:31
|
Revision: 1575 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1575&view=rev Author: roman_yakovenko Date: 2009-01-15 07:06:24 +0000 (Thu, 15 Jan 2009) Log Message: ----------- update load_gccxml_configuration functionality and integrate it with tests Modified Paths: -------------- pygccxml_dev/pygccxml/parser/config.py pygccxml_dev/unittests/autoconfig.py pygccxml_dev/unittests/undname_creator_tester.py Modified: pygccxml_dev/pygccxml/parser/config.py =================================================================== --- pygccxml_dev/pygccxml/parser/config.py 2009-01-15 07:04:23 UTC (rev 1574) +++ pygccxml_dev/pygccxml/parser/config.py 2009-01-15 07:06:24 UTC (rev 1575) @@ -194,7 +194,7 @@ config_t = gccxml_configuration_t #backward computability -def load_gccxml_configuration( configuration ): +def load_gccxml_configuration( configuration, **defaults ): """loads GCC-XML configuration from a file Configuration file sceleton: @@ -230,7 +230,16 @@ gccxml_cfg = gccxml_configuration_t() if not parser.has_section( 'gccxml' ): return gccxml_cfg + + values = defaults + if not values: + values = {} + for name, value in parser.items( 'gccxml' ): + if value.strip(): + values[ name ] = value + + for name, value in values.iteritems(): value = value.strip() if name == 'gccxml_path': gccxml_cfg.gccxml_path = value Modified: pygccxml_dev/unittests/autoconfig.py =================================================================== --- pygccxml_dev/unittests/autoconfig.py 2009-01-15 07:04:23 UTC (rev 1574) +++ pygccxml_dev/unittests/autoconfig.py 2009-01-15 07:06:24 UTC (rev 1575) @@ -27,77 +27,19 @@ import pygccxml print 'unittests will run on DEVELOPMENT version' -compiler = pygccxml.utils.native_compiler.get_gccxml_compiler() -print 'GCCXML configured to simulate compiler ', compiler pygccxml.declarations.class_t.USE_DEMANGLED_AS_NAME = True class cxx_parsers_cfg: - keywd = { 'working_directory' : data_directory - , 'define_symbols' : [ gccxml_version ] - , 'compiler' : compiler } + gccxml = pygccxml.parser.load_gccxml_configuration( 'gccxml.cfg' + , gccxml_path=gccxml_path + , working_directory=data_directory + , compiler=pygccxml.utils.native_compiler.get_gccxml_compiler() ) + gccxml.define_symbols.append( gccxml_version ) if 'win' in sys.platform: - keywd['define_symbols'].append( '__PYGCCXML_%s__' % compiler.upper() ) - if 'msvc9' == compiler: - keywd['define_symbols'].append( '_HAS_TR1=0' ) + gccxml.define_symbols.append( '__PYGCCXML_%s__' % gccxml.compiler.upper() ) + if 'msvc9' == gccxml.compiler: + gccxml.define_symbols.append( '_HAS_TR1=0' ) - - if os.path.exists( os.path.join( gccxml_path, 'gccxml' ) ) \ - or os.path.exists( os.path.join( gccxml_path, 'gccxml.exe' ) ): - keywd[ 'gccxml_path'] = gccxml_path - gccxml = pygccxml.parser.gccxml_configuration_t( **keywd ) - - #~ pdb_loader = None - #~ if sys.platform == 'win32': - #~ from pygccxml.msvc import mspdb - #~ pdb_file = os.path.join( data_directory, 'msvc_build', 'Debug', 'msvc_build.pdb' ) - #~ if os.path.exists( pdb_file ): - #~ pdb_loader = mspdb.decl_loader_t( pdb_file ) - #~ pdb_loader.read() - -#~ def get_pdb_global_ns(): - #~ if cxx_parsers_cfg.pdb_loader: - #~ return cxx_parsers_cfg.pdb_loader.global_ns - -#~ try: - #~ import pydsc - #~ pydsc.include( r'D:\pygccxml_sources\sources\pygccxml_dev' ) - #~ pydsc.ignore( [ 'Yakovenko' - #~ , 'Bierbaum' - #~ , 'org' - #~ , 'http' - #~ , 'bool' - #~ , 'str' - #~ , 'www' - #~ , 'param' - #~ , 'txt' - #~ , 'decl' - #~ , 'decls' - #~ , 'namespace' - #~ , 'namespaces' - #~ , 'enum' - #~ , 'const' - #~ , 'GCC' - #~ , 'xcc' - #~ , 'TODO' - #~ , 'typedef' - #~ , 'os' - #~ , 'normcase' - #~ , 'normpath' - #~ , 'scopedef' - #~ , 'ira'#part of Matthias mail address - #~ , 'uka'#part of Matthias mail address - #~ , 'de'#part of Matthias mail address - #~ , 'dat'#file extension of directory cache - #~ , 'config'#parameter description - #~ , 'gccxml'#parameter description - #~ , 'Py++' - #~ , 'pygccxml' - #~ , 'calldef' - #~ , 'XXX' - #~ , 'wstring' - #~ , 'py' - #~ ] ) -#~ except ImportError: - #~ pass +print 'GCCXML configured to simulate compiler ', cxx_parsers_cfg.gccxml.compiler Modified: pygccxml_dev/unittests/undname_creator_tester.py =================================================================== --- pygccxml_dev/unittests/undname_creator_tester.py 2009-01-15 07:04:23 UTC (rev 1574) +++ pygccxml_dev/unittests/undname_creator_tester.py 2009-01-15 07:06:24 UTC (rev 1575) @@ -41,7 +41,7 @@ #typeinfo name for number_t , '_ZTI8number_t' , '_ZTV8number_t' - , '_ZTS8number_t' + , '_ZTS8number_t' #it seems that gccxml doesn't report this one , '_ZNSt12auto_ptr_refI8number_tEC1EPS0_' #the following are some global symbols @@ -65,7 +65,7 @@ tester_t.global_ns = declarations.get_global_namespace( decls ) tester_t.global_ns.init_optimizer() - process = subprocess.Popen( args='scons msvc_compiler=%s' % autoconfig.compiler + process = subprocess.Popen( args='scons msvc_compiler=%s' % autoconfig.cxx_parsers_cfg.gccxml.compiler , shell=True , stdin=subprocess.PIPE , stdout=subprocess.PIPE @@ -94,7 +94,7 @@ symbols, parser = binary_parsers.merge_information( self.global_ns, fname, runs_under_unittest=True ) self.failUnless( len(symbols) == expected_symbols , "The expected symbols number(%d), is different frm the actual one(%d)" - % ( expected_symbols, len(symbols) ) ) + % ( expected_symbols, len(symbols) ) ) self.failUnless( 'identity' in symbols ) blob_names = set() @@ -118,7 +118,9 @@ blob_names.difference_update(common) if not self.known_issues.issubset( blob_names ): blob_names.difference_update( self.known_issues ) - msg = [ "undecorate_decl - failed" ] + if sys.version_info[0] == 2 and sys.version_info[1] == 5: + if 0 == len(decl_blob_names) and 0 ==len(blob_names): + return msg.append( "decl_blob_names :" ) for i in decl_blob_names: msg.append( '\t==>%s<==' % i ) @@ -130,11 +132,11 @@ def test_map_file( self ): if 'win32' in sys.platform: - self.__tester_impl( self.map_file ) + self.__tester_impl( self.map_file, 71 ) def test_dll_file( self ): if 'win32' in sys.platform: - self.__tester_impl( self.dll_file ) + self.__tester_impl( self.dll_file, 71 ) def test_z_compare_parsers( self ): if 'win32' not in sys.platform: @@ -159,7 +161,7 @@ if 'linux2' in sys.platform: self.__tester_impl( self.so_file, 64 ) - def dont_test_print( self ): + def dont_test_print( self ): """primary used for debugging""" symbols, parser = binary_parsers.merge_information( self.global_ns, self.so_file, runs_under_unittest=True ) for f in self.global_ns.calldefs( allow_empty=True, recursive=True ): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |