def testReporter(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check the synthesis reporter self.assertTrue( callable(project.get_reporter()) )
def testGenerics(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check the synthesis generics self.assertDictEqual( self.project_generics, project.get_generics(), )
def testProjectConstraints(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check the project constraints self.assertEqual( self.project_constraints, [os.path.basename(c.path) for c in project.get_constraints()], )
def testSimulationDirectory(self): project = Project() XmlProjectParser.load_project(self.project_path, project) abs_path = os.path.join( os.path.abspath(self.root), self.simulation_directory ) self.assertEqual(project.get_simulation_directory(), abs_path)
def testProjectPart(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check project part self.assertEqual( self.project_part, project.get_fpga_part() )
def testSimulationToolName(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check simulation tool name self.assertEqual( self.simulation_tool_name, project.get_simulation_tool_name() )
def testSynthesisToolName(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check synthesis tool name self.assertEqual( self.synthesis_tool_name, project.get_synthesis_tool_name() )
def testPreprocessor(self): project = Project() XmlProjectParser.load_project(self.project_path, project) files = project.get_files() preprocessors = list( filter(lambda x: os.path.exists(x.preprocessor), files)) self.assertTrue(len(preprocessors) > 0) project.run_preprocessors()
def testPreprocessor(self): project = Project() XmlProjectParser.load_project(self.project_path, project) files = project.get_files() preprocessors = list( filter( lambda x: os.path.exists(x.preprocessor), files ) ) self.assertTrue(len(preprocessors) > 0) project.run_preprocessors()
def testFileSet(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check the file set loaded from the project expected_files = [] for libname in self.project_structure.keys(): files = self.project_structure[libname] for path in files: expected_files.append(os.path.basename(path)) self.assertEqual( sorted(expected_files), sorted([os.path.basename(f.path) for f in project.get_files()]), )
def do_load_project(self, path): """Load the given project XML file: load_project <path_to_project>""" path = os.path.abspath(path) if os.path.exists(path) and os.path.isfile(path): try: log.info( 'Loading {0} in current working directory: {1}'.format( path, os.getcwd())) XmlProjectParser.load_project(path, self.project) except: log.error('The project could not be loaded due to an error:') log.error(traceback.format_exc()) else: log.error('File not found: {0}'.format(path))
def do_load_project(self, path): """Load the given project XML file: load_project <path_to_project>""" path = os.path.abspath(path) if os.path.exists(path) and os.path.isfile(path): try: log.info( 'Loading {0} in current working directory: {1}'.format( path, os.getcwd() ) ) XmlProjectParser.load_project(path, self.project) except: log.error('The project could not be loaded due to an error:') log.error(traceback.format_exc()) else: log.error('File not found: {0}'.format(path))
def locateProjects(self): """ Return a list of projects found in the current path. """ projects = [] logging.getLogger("chiptools").setLevel(logging.CRITICAL) for filePath in os.listdir(os.getcwd()): if filePath.endswith('.xml'): try: tempProject = Project() # Load the XML file XmlProjectParser.load_project(filePath, tempProject) # If the project contains files we can add it to our list files = tempProject.get_files() files = files if files is not None else [] if len(files) != 0: projects.append(filePath) except: pass logging.getLogger("chiptools").setLevel(logging.INFO) return projects
def locateProjects(self): """ Return a list of projects found in the current path. """ projects = [] logging.getLogger("chiptools").setLevel( logging.CRITICAL ) for filePath in os.listdir(os.getcwd()): if filePath.endswith('.xml'): try: tempProject = Project() # Load the XML file XmlProjectParser.load_project(filePath, tempProject) # If the project contains files we can add it to our list files = tempProject.get_files() files = files if files is not None else [] if len(files) != 0: projects.append(filePath) except: pass logging.getLogger("chiptools").setLevel(logging.INFO) return projects
def testReporter(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check the synthesis reporter self.assertTrue(callable(project.get_reporter()))
def testSimulationDirectory(self): project = Project() XmlProjectParser.load_project(self.project_path, project) abs_path = os.path.join(os.path.abspath(self.root), self.simulation_directory) self.assertEqual(project.get_simulation_directory(), abs_path)
def testProjectLoad(self): project = Project() XmlProjectParser.load_project(self.project_path, project)
def testProjectPart(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check project part self.assertEqual(self.project_part, project.get_fpga_part())
def testSimulationToolName(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check simulation tool name self.assertEqual(self.simulation_tool_name, project.get_simulation_tool_name())
def testSynthesisToolName(self): project = Project() XmlProjectParser.load_project(self.project_path, project) # Check synthesis tool name self.assertEqual(self.synthesis_tool_name, project.get_synthesis_tool_name())