Adding coverage script for jenkins.

This commit is contained in:
mdlewisfb
2018-10-22 11:10:59 -07:00
parent 9fd59bc6d5
commit cdeeea475d
2 changed files with 16 additions and 1 deletions

13
.ci/coverage.py Normal file
View File

@@ -0,0 +1,13 @@
from lcov_cobertura import LcovCobertura
LCOV_FILE = 'build/coverage/test-coverage.info'
OUT_FILE = 'build/coverage/test-coverage.xml'
with open(LCOV_FILE) as fr:
data = fr.read()
converter = LcovCobertura(data)
res = converter.convert()
with open(OUT_FILE, 'w') as fw:
fw.write(res)

View File

@@ -177,7 +177,9 @@ clean:
.PHONY: FORCE
ci: CFLAGS += -Werror
ci: clean test
ci: CFLAGS += -ftest-coverage -fprofile-arcs -fprofile-dir=$(PATHC)$*/
ci: COV_CMDS = @mkdir -p $(PATHC)$* && mv *.gcno $(PATHC)$*
ci: clean junit coverage
# Add flags and create extra commands to execute after compiler iff coverage is being done.
cov: CFLAGS += -ftest-coverage -fprofile-arcs -fprofile-dir=$(PATHC)$*/