[pygccxml-commit] SF.net SVN: pygccxml:[1493] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
|
From: <rom...@us...> - 2008-12-24 20:44:07
|
Revision: 1493
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1493&view=rev
Author: roman_yakovenko
Date: 2008-12-24 20:44:03 +0000 (Wed, 24 Dec 2008)
Log Message:
-----------
add convenience function - exported_symbols.load_from_file
Modified Paths:
--------------
pygccxml_dev/pygccxml/msvc/common_utils.py
pygccxml_dev/unittests/autoconfig.py
pygccxml_dev/unittests/undname_creator_tester.py
Modified: pygccxml_dev/pygccxml/msvc/common_utils.py
===================================================================
--- pygccxml_dev/pygccxml/msvc/common_utils.py 2008-12-24 08:16:07 UTC (rev 1492)
+++ pygccxml_dev/pygccxml/msvc/common_utils.py 2008-12-24 20:44:03 UTC (rev 1493)
@@ -3,6 +3,7 @@
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
+import os
import re
import ctypes
import ctypes.wintypes
@@ -225,3 +226,14 @@
for blob in blobs:
result[ blob ] = undecorate_blob( blob )
return result
+
+ @staticmethod
+ def load_from_file( fname ):
+ ext = os.path.splitext( fname )[1]
+ if '.dll' == ext:
+ return exported_symbols.load_from_dll_file( fname )
+ elif '.map' == ext:
+ return exported_symbols.load_from_map_file( fname )
+ else:
+ raise RuntimeError( "Don't know how to read exported symbols from file '%s'"
+ % fname )
Modified: pygccxml_dev/unittests/autoconfig.py
===================================================================
--- pygccxml_dev/unittests/autoconfig.py 2008-12-24 08:16:07 UTC (rev 1492)
+++ pygccxml_dev/unittests/autoconfig.py 2008-12-24 20:44:03 UTC (rev 1493)
@@ -35,7 +35,7 @@
class cxx_parsers_cfg:
keywd = { 'working_directory' : data_directory
- , 'define_symbols' : [ gccxml_version ]#, '_HAS_TR1 0' ]
+ , 'define_symbols' : [ gccxml_version ]
, 'compiler' : compiler }
if 'win' in sys.platform:
Modified: pygccxml_dev/unittests/undname_creator_tester.py
===================================================================
--- pygccxml_dev/unittests/undname_creator_tester.py 2008-12-24 08:16:07 UTC (rev 1492)
+++ pygccxml_dev/unittests/undname_creator_tester.py 2008-12-24 20:44:03 UTC (rev 1493)
@@ -48,7 +48,9 @@
else:
return False
- def __tester_impl( self, symbols ):
+ def __tester_impl( self, fname ):
+ symbols = msvc.exported_symbols.load_from_file( fname )
+
undecorated_blob_names = set()
for blob in symbols.iterkeys():
undname = msvc.undecorate_blob( blob )
@@ -80,14 +82,11 @@
def test_map_file( self ):
map_file = os.path.join( autoconfig.data_directory, 'msvc', 'release', 'mydll.map' )
- symbols = msvc.exported_symbols.load_from_map_file( map_file )
- self.__tester_impl( symbols )
+ self.__tester_impl( map_file )
-
def test_dll_file( self ):
dll_file = os.path.join( autoconfig.data_directory, 'msvc', 'release', 'mydll.dll' )
- symbols = msvc.exported_symbols.load_from_dll_file( dll_file )
- self.__tester_impl( symbols )
+ self.__tester_impl( dll_file )
def create_suite():
suite = unittest.TestSuite()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|