def test(self): src_reader = parser.source_reader_t(self.config) src_decls = src_reader.read_file(self.__fname) xmlfile = src_reader.create_xml_file(self.__fname) print(xmlfile) try: conf_t = parser.file_configuration_t fconfig = conf_t( data=xmlfile, start_with_declarations=None, content_type=conf_t.CONTENT_TYPE.GCCXML_GENERATED_FILE) prj_reader = parser.project_reader_t(self.config) prj_decls = prj_reader.read_files( [fconfig], compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE) declarations.dump_declarations( src_decls, os.path.join( autoconfig.build_directory, 'xmlfile_reader.src.txt')) declarations.dump_declarations( prj_decls, os.path.join( autoconfig.build_directory, 'xmlfile_reader.prj.txt')) if src_decls != prj_decls: self.fail( "There is a difference between declarations in file %s." % self.__fname) finally: pass # utils.remove_file_no_raise( xmlfile, self.config )
def test(self): src_reader = parser.source_reader_t(self.config) src_decls = src_reader.read_file(self.__fname) xmlfile = src_reader.create_xml_file(self.__fname) print(xmlfile) try: conf_t = parser.file_configuration_t fconfig = conf_t( data=xmlfile, start_with_declarations=None, content_type=conf_t.CONTENT_TYPE.GCCXML_GENERATED_FILE) prj_reader = parser.project_reader_t(self.config) prj_decls = prj_reader.read_files( [fconfig], compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE) declarations.dump_declarations( src_decls, os.path.join( autoconfig.build_directory, 'xmlfile_reader.src.txt')) declarations.dump_declarations( prj_decls, os.path.join( autoconfig.build_directory, 'xmlfile_reader.prj.txt')) if src_decls != prj_decls: self.fail( "There is a difference between declarations in file %s." % self.__fname) finally: pass # utils.remove_file_no_raise( xmlfile )
def test(self): prj_reader = parser.project_reader_t( self.config ) prj_decls = prj_reader.read_files( self.__files , compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE ) src_reader = parser.source_reader_t( self.config ) src_decls = src_reader.read_file( 'separate_compilation/all.h' ) declarations.dump_declarations( src_decls , os.path.join( autoconfig.build_directory, 'separate_compilation.sr.txt' ) ) declarations.dump_declarations( prj_decls , os.path.join( autoconfig.build_directory, 'separate_compilation.pr.txt' ) ) self.failUnless( src_decls == prj_decls, "There is a difference between declarations" )
def test(self): prj_reader = parser.project_reader_t(self.config) prj_decls = prj_reader.read_files( self.__files, compilation_mode=parser.COMPILATION_MODE.FILE_BY_FILE) src_reader = parser.source_reader_t(self.config) src_decls = src_reader.read_file('separate_compilation/all.h') declarations.dump_declarations( src_decls, os.path.join(autoconfig.build_directory, 'separate_compilation.sr.txt')) declarations.dump_declarations( prj_decls, os.path.join(autoconfig.build_directory, 'separate_compilation.pr.txt')) self.assertTrue(src_decls == prj_decls, "There is a difference between declarations")