2015-05-17 18:07:24 +02:00
|
|
|
|
|
|
|
# Makefile to build and run all tests
|
|
|
|
|
|
|
|
SUBDIRS = \
|
2015-07-02 10:46:45 +02:00
|
|
|
att_db \
|
2017-02-27 20:31:30 +01:00
|
|
|
avdtp \
|
2019-09-20 13:16:20 +02:00
|
|
|
avdtp_util \
|
2019-09-14 22:36:27 +02:00
|
|
|
base64 \
|
2015-05-17 18:07:24 +02:00
|
|
|
ble_client \
|
2017-02-27 20:31:30 +01:00
|
|
|
btstack_link_key_db \
|
2019-09-14 22:36:27 +02:00
|
|
|
crypto \
|
2015-05-17 18:07:24 +02:00
|
|
|
des_iterator \
|
2019-09-23 14:01:17 +02:00
|
|
|
embedded \
|
2019-09-18 13:13:05 +02:00
|
|
|
flash_tlv \
|
2015-05-17 18:07:24 +02:00
|
|
|
gatt_client \
|
2019-09-23 14:01:17 +02:00
|
|
|
gatt_server \
|
2020-04-02 16:22:07 +02:00
|
|
|
gap \
|
2015-08-20 17:06:54 +02:00
|
|
|
hfp \
|
2019-09-14 22:36:27 +02:00
|
|
|
hid_parser \
|
2015-05-17 18:07:24 +02:00
|
|
|
linked_list \
|
2019-10-22 16:42:03 +02:00
|
|
|
map_test \
|
2019-09-18 17:29:48 +02:00
|
|
|
mesh \
|
2019-09-14 22:36:27 +02:00
|
|
|
obex \
|
|
|
|
ring_buffer \
|
2019-09-18 17:42:10 +02:00
|
|
|
sdp \
|
2015-05-17 18:07:24 +02:00
|
|
|
sdp_client \
|
2015-07-16 23:28:09 +02:00
|
|
|
security_manager \
|
2019-09-14 22:36:27 +02:00
|
|
|
tlv_posix \
|
|
|
|
|
2019-09-23 14:01:17 +02:00
|
|
|
# not testing anything in source tree
|
|
|
|
# maths \
|
2019-09-14 22:36:27 +02:00
|
|
|
|
|
|
|
# test fails
|
|
|
|
|
|
|
|
# not unit-tests
|
2019-09-23 14:01:17 +02:00
|
|
|
# avrcp \
|
2019-09-14 22:36:27 +02:00
|
|
|
# map_client \
|
|
|
|
# sbc \
|
2019-09-23 14:01:17 +02:00
|
|
|
.PHONY: coverage
|
2015-07-03 11:01:27 +02:00
|
|
|
|
2015-05-17 18:07:24 +02:00
|
|
|
subdirs:
|
|
|
|
echo Building all tests
|
2015-10-12 10:59:06 +02:00
|
|
|
@set -e; \
|
2015-05-17 18:07:24 +02:00
|
|
|
for dir in $(SUBDIRS); do \
|
|
|
|
$(MAKE) -C $$dir; \
|
|
|
|
done
|
|
|
|
|
|
|
|
clean:
|
|
|
|
echo Clean all test
|
2015-10-12 10:59:06 +02:00
|
|
|
@set -e; \
|
2015-05-17 18:07:24 +02:00
|
|
|
for dir in $(SUBDIRS); do \
|
|
|
|
$(MAKE) -C $$dir clean; \
|
|
|
|
done
|
|
|
|
|
|
|
|
test:
|
|
|
|
echo Run all test
|
2015-10-12 10:59:06 +02:00
|
|
|
@set -e; \
|
2015-05-17 18:07:24 +02:00
|
|
|
for dir in $(SUBDIRS); do \
|
|
|
|
$(MAKE) -C $$dir test; \
|
|
|
|
done
|
|
|
|
|
2020-08-28 23:38:06 +02:00
|
|
|
test-coverage:
|
2019-09-23 14:01:17 +02:00
|
|
|
# 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
|
2020-08-28 23:38:06 +02:00
|
|
|
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/test/*" --output-file coverage-unit.info
|
|
|
|
|
|
|
|
coverage: test-coverage
|
|
|
|
|
|
|
|
# TODO: download pts coverage
|
|
|
|
# ...
|
|
|
|
# combine unit and pts
|
|
|
|
# lcov --rc lcov_branch_coverage=1 -a coverage-pts.info -a coverage-unit.info --output-file coverage.info
|
|
|
|
cp coverage-unit.info coverage.info
|
|
|
|
|
|
|
|
# create bat subset
|
|
|
|
./coverage_subset_bat.py coverage.info coverage-bat.info
|
|
|
|
|
2019-09-23 14:01:17 +02:00
|
|
|
# generate html output
|
2020-08-28 23:38:06 +02:00
|
|
|
genhtml coverage-unit.info --branch-coverage --output-directory coverage-unit
|
|
|
|
genhtml coverage-bat.info --branch-coverage --output-directory coverage-bat
|
|
|
|
genhtml coverage.info --branch-coverage --output-directory coverage
|
2019-09-23 16:15:22 +02:00
|
|
|
|
|
|
|
coverage-freertos-ble:
|
|
|
|
./coverage_filter.py src/mesh src/classic
|