Compare commits

..

1 Commits

Author SHA1 Message Date
Thomas Klaehn
cd66f01149 Add code coverage report generation 2019-07-16 12:13:44 +02:00
2 changed files with 22 additions and 2 deletions

17
.vscode/tasks.json vendored
View File

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

View File

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