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 \
avdtp \
avdtp_util \
avrcp \
base64 \
ble_client \
btstack_link_key_db \
crypto \
des_iterator \
embedded \
flash_tlv \
gatt_client \
gatt_server \
hfp \
hid_parser \
linked_list \
maths \
mesh \
obex \
ring_buffer \
@ -25,13 +25,17 @@ SUBDIRS = \
security_manager \
tlv_posix \
# not testing anything in source tree
# maths \
# test fails
# map_test \
# not unit-tests
# avrcp \
# map_client \
# sbc \
.PHONY: coverage
subdirs:
echo Building all tests
@ -54,8 +58,15 @@ test:
$(MAKE) -C $$dir test; \
done
coverage: test
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
coverage:
# 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