def add_file(self, path, library='work', **attribs): """Add the given file to the project.""" path = utils.relativePathToAbs(path, self.root) # Default synthesis to true file_object = File( path=path, library=library, **attribs ) if library not in self.project_data: self.project_data[library] = [] if file_object not in self.project_data[library]: # Both a dictionary and list of files are maintained so that # compilation order can be preserved self.project_data[library].append(file_object) self.file_list.append(file_object)
def add_unittest(self, path, **attribs): """Add the given TestSuite file to the project.""" path = utils.relativePathToAbs(path, self.root) unit = UnitTestFile(path=path, **attribs) # Perform TestSuite loading on the supplied path if os.path.exists(path): # Convert the testsuite path into an unpacked testsuite # for each file object that has a link to a test suite. unpacked_testsuite = testloader.load_tests( path, self.get_simulation_directory(), ) # Modify the file object, replacing the testsuite path # string with the testsuite object that we just # unpacked. unit.testsuite = unpacked_testsuite self.tests.append(unit)
def add_constraints(self, path, **attribs): """Add the given constraints file to the project.""" path = utils.relativePathToAbs(path, self.root) self.constraints.append(Constraints(path=path, **attribs))