test: update coverage make target

This commit is contained in:
Matthias Ringwald 2019-09-23 14:01:17 +02:00
parent 713ac74453
commit 464d3e4332

View File

@ -5,18 +5,18 @@ SUBDIRS = \
att_db \ att_db \
avdtp \ avdtp \
avdtp_util \ avdtp_util \
avrcp \
base64 \ base64 \
ble_client \ ble_client \
btstack_link_key_db \ btstack_link_key_db \
crypto \ crypto \
des_iterator \ des_iterator \
embedded \
flash_tlv \ flash_tlv \
gatt_client \ gatt_client \
gatt_server \
hfp \ hfp \
hid_parser \ hid_parser \
linked_list \ linked_list \
maths \
mesh \ mesh \
obex \ obex \
ring_buffer \ ring_buffer \
@ -25,13 +25,17 @@ SUBDIRS = \
security_manager \ security_manager \
tlv_posix \ tlv_posix \
# not testing anything in source tree
# maths \
# test fails # test fails
# map_test \ # map_test \
# not unit-tests # not unit-tests
# avrcp \
# map_client \ # map_client \
# sbc \ # sbc \
.PHONY: coverage
subdirs: subdirs:
echo Building all tests echo Building all tests
@ -54,8 +58,15 @@ test:
$(MAKE) -C $$dir test; \ $(MAKE) -C $$dir test; \
done done
coverage: test coverage:
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/usr/*" --exclude "*/3rd-party/tinydir/*" --exclude "*/platform/posix/*" --exclude "*/test/*" --output-file coverage.info # delete trace data
rm -f coverage.info
find . -name "*.gcda" -type f -delete
# collect all files
# lcov --capture --initial --directory . --output-file coverage.info
# run tests
make test
# collect traces
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/3rd-party/tinydir/*" --exclude "*/platform/posix/*" --exclude "*/test/*" --output-file coverage.info
# generate html output
genhtml coverage.info --branch-coverage --output-directory coverage-html genhtml coverage.info --branch-coverage --output-directory coverage-html