From 4645384825b35e0f0e0ca006e31495681bab5ed8 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 26 Feb 2020 16:37:47 +0000 Subject: [PATCH] Initial commit - gitignore and test fixtures --- .gitignore | 13 +++++++++++++ .gitlab-ci.yml | 20 ++++++++++++++++++++ testing/check_asn1.py | 17 +++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 .gitignore create mode 100644 .gitlab-ci.yml create mode 100644 testing/check_asn1.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c0dc94 --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +# OS cruft +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Standards cruft +.doc +.docx +.zip \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9268863 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +image: "python:3.7" + +before_script: + - python --version + - pip install -q asn1tools + - pip install -q lxml + - pip install -q xmlschema + +stages: + - Check ASN.1 + +checkASN1: + stage: Check ASN.1 + script: + - python test/check_asn1.py + +checkXSD: + stage: Check ASN.1 + script: + - python test/check_xsd.py \ No newline at end of file diff --git a/testing/check_asn1.py b/testing/check_asn1.py new file mode 100644 index 0000000..9c896b6 --- /dev/null +++ b/testing/check_asn1.py @@ -0,0 +1,17 @@ +from asn1tools import parse_files, ParseError +import sys +from glob import glob +from pathlib import Path + + +schemaFileGlob = glob("*.asn1") +if (len(schemaFileGlob) != 1): + sys.exit("Found {0} XSD files, 1 expected".format(len(schemaFileGlob))) + +schemaFile = schemaFileGlob[0] +try: + parse_files(schemaFile) +except ParseError as ex: + sys.exit("ASN1 parser error: " + ex) + +print ("ASN1 schema OK") -- GitLab