Loading testing/parse_asn1.py 0 → 100644 +30 −0 Original line number Diff line number Diff line import logging from asn1tools import parse_files, ParseError from pathlib import Path from pprint import pprint if __name__ == '__main__': fileList = list(Path(".").rglob("*.asn1")) + list(Path(".").rglob("*.asn")) if len(fileList) == 0: logging.warning ("No files specified") exit(0) print ("ASN.1 Parser checks:") print ("-----------------------------") logging.info("Parsing files...") errorCount = 0 for f in fileList: try: parse_files(str(f)) except ParseError as ex: logging.info (f" {f}: Failed - {ex!r}") print (f" {f}: Failed - {ex!r}") errorCount += 1 continue print (f" {f}: OK") print ("-----------------------------") print (f"Parse errors: {errorCount}") print ("-----------------------------") exit(errorCount) Loading
testing/parse_asn1.py 0 → 100644 +30 −0 Original line number Diff line number Diff line import logging from asn1tools import parse_files, ParseError from pathlib import Path from pprint import pprint if __name__ == '__main__': fileList = list(Path(".").rglob("*.asn1")) + list(Path(".").rglob("*.asn")) if len(fileList) == 0: logging.warning ("No files specified") exit(0) print ("ASN.1 Parser checks:") print ("-----------------------------") logging.info("Parsing files...") errorCount = 0 for f in fileList: try: parse_files(str(f)) except ParseError as ex: logging.info (f" {f}: Failed - {ex!r}") print (f" {f}: Failed - {ex!r}") errorCount += 1 continue print (f" {f}: OK") print ("-----------------------------") print (f"Parse errors: {errorCount}") print ("-----------------------------") exit(errorCount)