Commit 73f8d334 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Adapt Makefiles' coverage logic to CircleCI

Make sure the coverage reports are copied to CircleCI artifacts,
and report them in colored output in interactive terminals only.
parent 139b9821
PY_SRC:=$(wildcard dmt/asn2dataModel.py dmt/aadl2glueC.py dmt/smp2asn.py dmt/*mappers/[a-zA-Z]*py dmt/commonPy/[a-zA-Z]*py)
PY_SRC:=$(filter-out dmt/B_mappers/antlr.main.py dmt/A_mappers/Stubs.py, ${PY_SRC})
all: flake8 pylint mypy
allLocal: flake8 pylint mypy coverage
all: flake8 pylint mypy coverage
flake8:
@echo Performing syntax checks via flake8...
......@@ -21,4 +19,4 @@ coverage:
@echo Performing coverage checks...
@$(MAKE) -C tests-coverage || exit 1
.PHONY: flake8 pylint mypy
.PHONY: flake8 pylint mypy coverage
......@@ -163,7 +163,7 @@ def main():
backend.OnStartup(modelingLanguage, list(uniqueASNfiles.keys()), configMT.outputDir, badTypes)
if 'OnShutdown' in dir(backend):
backend.OnShutdown(badTypes)
continue
continue # bug in coverage.py... # pragma: no cover
# Work on each ASN.1 file's types
for asnFile in uniqueASNfiles:
......
......@@ -26,7 +26,11 @@ ___dmt_B_mappers_%.py,cover: ../dmt/B_mappers/%.py mini_cv.aadl DataView.aadl Da
PYTHONPATH=.. LANG=C LC_ALL=C python3 -m coverage annotate -d . ../dmt/aadl2glueC.py ../dmt/B_mappers/*.py ../dmt/commonPy/*.py
check:
ifneq ($(CIRCLECI),)
@for i in $(PYSRC_B_COVER) ; do echo Checking $$i ... ; ./checkCoverage.pl $$i || { echo $$i failed... ; cp $$i ${CIRCLE_ARTIFACTS} ; exit 1 ; } ; done
else
@for i in $(PYSRC_B_COVER) ; do echo Checking $$i ... ; ./checkCoverage.pl $$i || { ( echo $$i ; ./review.pl $$i ) | less -RS ; echo $$i had issues... ; exit 1 ; } ; done
endif
clean:
${COVERAGE} erase
......
......@@ -30,7 +30,11 @@ ___dmt_A_mappers_%.py,cover: ../A_mappers/%.py DataTypesSimulink.asn
PYTHONPATH=.. LANG=C LC_ALL=C python3 -m coverage annotate -d . ../dmt/asn2dataModel.py ../dmt/A_mappers/*.py ../dmt/commonPy/*.py
check:
ifneq ($(CIRCLECI),)
@for i in ___dmt_commonPy_createInternalTypes.py,cover ___dmt_asn2dataModel.py,cover $(PYSRC_A_COVER) ; do echo Checking $$i ... ; ./checkCoverage.pl $$i || { echo $$i failed... ; cp $$i ${CIRCLE_ARTIFACTS} ; exit 1 ; } ; done
else
@for i in ___dmt_commonPy_createInternalTypes.py,cover ___dmt_asn2dataModel.py,cover $(PYSRC_A_COVER) ; do echo Checking $$i ... ; ./checkCoverage.pl $$i || { ( echo $$i ; ./review.pl $$i ) | less -RS ; exit 1 ; } ; done
endif
clean:
${COVERAGE} erase
......
......@@ -9,7 +9,11 @@ all:
PYTHONPATH=.. LANG=C LC_ALL=C python3 -m coverage run -a -m dmt.smp2asn -o smp2.asn -a nonexisting.asn nonexisting.cat >/dev/null 2>&1 ; exit 0
PYTHONPATH=.. LANG=C LC_ALL=C python3 -m coverage run -a -m dmt.smp2asn -o smp2.asn -a DataTypesSimulink.asn -v -p datatypessimulink.cat >/dev/null 2>&1 || exit 1
PYTHONPATH=.. LANG=C LC_ALL=C ${COVERAGE} annotate -d . ../dmt/smp2asn.py ../dmt/commonPy/*.py || exit 1
ifneq ($(CIRCLECI),)
./checkCoverage.pl ___dmt_smp2asn.py,cover || { echo smp2asn.py failed... ; cp __dmt_smp2asn.py,cover ${CIRCLE_ARTIFACTS} ; exit 1 ; }
else
./checkCoverage.pl ___dmt_smp2asn.py,cover || { echo smp2asn.py ; ./review.pl ___dmt_smp2asn.py,cover | less -RS ; exit 1 ; }
endif
# ./checkCoverage.pl ___dmt_commonPy_commonSMP2.py,cover || { echo commonSMP2.py ; ./review.pl ___dmt_commonPy_commonSMP2.py,cover | less -RS ; exit 1 ; }
clean:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment