Commit e325dc36 authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Update testing

parent 1b6cae88
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -3,6 +3,8 @@ from compile_asn import *




if __name__ == '__main__':
if __name__ == '__main__':
    log = logging.getLogger()
    log.setLevel(logging.INFO)
    parseErrors, compileErrors, parser = validateAllASN1FilesInPath("./")
    parseErrors, compileErrors, parser = validateAllASN1FilesInPath("./")
    parseErrorCount = 0
    parseErrorCount = 0
    print ("ASN.1 Parser checks:")
    print ("ASN.1 Parser checks:")
+6 −2
Original line number Original line Diff line number Diff line
@@ -114,17 +114,21 @@ def compileASN1Files (fileList):
    except CompileError as ex:
    except CompileError as ex:
        logging.info (f"Compiler  error: {ex}")
        logging.info (f"Compiler  error: {ex}")
        errors.append(ex)
        errors.append(ex)
        return errors, None
    except ParseError as ex:
    except ParseError as ex:
        logging.info (f"Parse error: {ex}")
        logging.info (f"Parse error: {ex}")
        errors.append(ex)
        errors.append(ex)
        return errors, None
    logging.info ("Compiled OK")
    logging.info ("Compiled OK")
    return errors, c
    return errors, c




def validateASN1Files (fileList):
def validateASN1Files (fileList):
    parseErrors = parseASN1Files(fileList)
    parseErrors = parseASN1Files(fileList)
    if len(parseErrors) > 0:
    errorCount = sum([len(v) for k,v in parseErrors.items()])
        logging.info ("Abandonding compile due to parse errors")
    if errorCount > 0:
        logging.info ("Abandoning compile due to parse errors")
        return parseErrors, [], None
    compileErrors, parser = compileASN1Files(fileList)
    compileErrors, parser = compileASN1Files(fileList)
    return parseErrors, compileErrors, parser
    return parseErrors, compileErrors, parser