def test_parse_dependencies(): """ Test to parse the dependencies of a cobol exe that use one submodule. Such a program exisits in the testfiles directory (TEST-PRINTER.cbl) """ deps = parser.parse_dependencies("test/testfiles/TEST-PRINTER.cbl") assert len(deps)
def compileCurrent(self, filePath, programType): """ Compiles the current file and its dependencies (executed in a background thread """ dependencies = parse_dependencies(filePath) globalStatus = True for path, pgmType in dependencies: status, messags = compiler.compile(path, pgmType) globalStatus &= status for msg in messags: self.compilerMsgReady.emit(msg) if status == 0: msg = pyqode.core.CheckerMessage( "Compilation succeeded", pyqode.core.MSG_STATUS_INFO, -1, icon=":/ide-icons/rc/accept.png", filename=path) msg.filename =path else: msg = pyqode.core.CheckerMessage( "Compilation failed", pyqode.core.MSG_STATUS_ERROR, -1, filename=path) msg.filename = path self.compilerMsgReady.emit(msg) status, messages = compiler.compile(filePath, programType) for msg in messages: self.compilerMsgReady.emit(msg) if status == 0: msg = pyqode.core.CheckerMessage( "Compilation succeeded", pyqode.core.MSG_STATUS_INFO, -1, icon=":/ide-icons/rc/accept.png", filename=filePath) else: msg = pyqode.core.CheckerMessage( "Compilation failed", pyqode.core.MSG_STATUS_ERROR, -1, filename=filePath) msg.filename = filePath self.compilerMsgReady.emit(msg) self.compilationFinished.emit(globalStatus)
def test_parse_dependencies_single_quotes(): """ See github #29 """ deps = parser.parse_dependencies("test/testfiles/TEST-SINGLE-QUOTES.cbl") assert len(deps)