[pygccxml-commit] SF.net SVN: pygccxml: [1151] pygccxml_dev
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2007-11-14 07:14:02
|
Revision: 1151 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1151&view=rev Author: roman_yakovenko Date: 2007-11-13 23:14:07 -0800 (Tue, 13 Nov 2007) Log Message: ----------- changing treatment of file path for new gccxml Modified Paths: -------------- pygccxml_dev/pygccxml/parser/scanner.py pygccxml_dev/pygccxml/parser/source_reader.py pygccxml_dev/unittests/decl_printer_tester.py pygccxml_dev/unittests/start_with_declarations_tester.py Modified: pygccxml_dev/pygccxml/parser/scanner.py =================================================================== --- pygccxml_dev/pygccxml/parser/scanner.py 2007-11-14 07:09:40 UTC (rev 1150) +++ pygccxml_dev/pygccxml/parser/scanner.py 2007-11-14 07:14:07 UTC (rev 1151) @@ -485,7 +485,7 @@ return operator def __read_version(self, attrs): - version = float( attrs.get(XML_AN_CVS_REVISION, None) ) + version = float( attrs.get(XML_AN_CVS_REVISION, 0.6) ) if version is None: version = "0.6" elif version < 1.117: Modified: pygccxml_dev/pygccxml/parser/source_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/source_reader.py 2007-11-14 07:09:40 UTC (rev 1150) +++ pygccxml_dev/pygccxml/parser/source_reader.py 2007-11-14 07:14:07 UTC (rev 1151) @@ -278,6 +278,8 @@ raise RuntimeError( "pygccxml error: file '%s' does not exist" % file ) def __produce_full_file( self, file_path ): + if 'win' in sys.platform or 'linux' in sys.platform: + file_path = file_path.replace( r'\/', os.path.sep ) if os.path.isabs( file_path ): return file_path try: Modified: pygccxml_dev/unittests/decl_printer_tester.py =================================================================== --- pygccxml_dev/unittests/decl_printer_tester.py 2007-11-14 07:09:40 UTC (rev 1150) +++ pygccxml_dev/unittests/decl_printer_tester.py 2007-11-14 07:14:07 UTC (rev 1151) @@ -3,18 +3,19 @@ # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +import os import unittest import autoconfig import parser_test_case from pygccxml import parser -from pygccxml import declarations +from pygccxml import declarations class tester_t( parser_test_case.parser_test_case_t ): def __init__(self, *args): parser_test_case.parser_test_case_t.__init__(self, *args) self.__files = [ - 'core_ns_join_1.hpp' + 'core_ns_join_1.hpp' , 'core_ns_join_2.hpp' , 'core_ns_join_3.hpp' , 'core_membership.hpp' @@ -28,6 +29,11 @@ , 'core_overloads_2.hpp' , 'typedefs_base.hpp' ] + + #~ for i, f in enumerate(self.__files): + #~ f = parser.create_cached_source_fc( os.path.join( autoconfig.data_directory, f) + #~ , os.path.join( autoconfig.data_directory, f + '.xml') ) + #~ self.__files[i] = f prj_reader = parser.project_reader_t( self.config ) self.decls = prj_reader.read_files( self.__files , compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE ) @@ -36,19 +42,19 @@ writer = lambda decl: None declarations.print_declarations( self.decls, writer=writer ) #declarations.print_declarations( self.decls ) - + def test__str__(self): decls = declarations.make_flatten(self.decls) for decl in decls: str(decl) - + def create_suite(): - suite = unittest.TestSuite() - suite.addTest( unittest.makeSuite(tester_t)) + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t)) return suite def run_suite(): unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": - run_suite() \ No newline at end of file + run_suite() Modified: pygccxml_dev/unittests/start_with_declarations_tester.py =================================================================== --- pygccxml_dev/unittests/start_with_declarations_tester.py 2007-11-14 07:09:40 UTC (rev 1150) +++ pygccxml_dev/unittests/start_with_declarations_tester.py 2007-11-14 07:14:07 UTC (rev 1151) @@ -16,9 +16,8 @@ def __init__(self, *args ): parser_test_case.parser_test_case_t.__init__( self, *args ) self.header = 'core_ns_join_1.hpp' - self.config = config.config_t( gccxml_path=autoconfig.gccxml_path - , working_directory=autoconfig.data_directory - , start_with_declarations=[ 'E11', 'ns::ns12::E13' ] ) + self.config = autoconfig.cxx_parsers_cfg.gccxml.clone() + self.config.start_with_declarations.extend([ 'E11', 'ns::ns12::E13' ] ) def __check_result(self, decls): E11 = find_declaration( decls, fullname='::E11' ) @@ -53,4 +52,4 @@ unittest.TextTestRunner(verbosity=2).run( create_suite() ) if __name__ == "__main__": - run_suite() \ No newline at end of file + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |