Compare commits

..

1 Commits

Author SHA1 Message Date
Thomas Klaehn
d2f7201a10 Add code coverage report generation 2019-07-15 23:55:17 +02:00
2 changed files with 2 additions and 22 deletions

17
.vscode/tasks.json vendored
View File

@ -87,23 +87,6 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "coverage",
"type":"shell",
"command": "make coverage",
"problemMatcher": {
"base": "$gcc",
"owner": "gcc",
"fileLocation": [
"relative",
"${workspaceFolder}"
]
},
"group": {
"kind": "build",
"isDefault": true
}
}
],
"presentation": {

View File

@ -6,6 +6,7 @@ CC = $(CROSS_COMPILE)gcc
CPP = $(CROSS_COMPILE)cpp
CHECK = cppcheck
LCOV = lcov
GENHTML = genhtml
SRC_DIR = src
OBJ_DIR = obj
@ -50,11 +51,7 @@ coverage: $(UNIT_TEST_TARGET)
@rm -f $(UNIT_TEST_OBJ_DIR)/*.gcda
@rm -f $(UNIT_TEST_OBJ_DIR)/*.gcno
$(LCOV) -c -d obj -d bin/test/unit/ -d src/ -d test/unit/ -o test.info --no-external
$(eval COVERAGE:=$(shell genhtml -o coverage/html test.info | grep 'lines' | egrep -o '[0-9]+.[0-9]+%'))
@echo
@echo Line coverage: $(COVERAGE)
@echo
$(GENHTML) -o coverage/html test.info
.PHONY: unit_test
build_unit_test: $(UNIT_TEST_TARGET)