btstack/test/Makefile

91 lines
1.8 KiB
Makefile
Raw Normal View History

# Makefile to build and run all tests
SUBDIRS = \
2015-07-02 10:46:45 +02:00
att_db \
avdtp \
2019-09-20 13:16:20 +02:00
avdtp_util \
2019-09-14 22:36:27 +02:00
base64 \
ble_client \
btstack_link_key_db \
2019-09-14 22:36:27 +02:00
crypto \
des_iterator \
2019-09-23 14:01:17 +02:00
embedded \
flash_tlv \
gatt_client \
2019-09-23 14:01:17 +02:00
gatt_server \
gap \
2015-08-20 17:06:54 +02:00
hfp \
2019-09-14 22:36:27 +02:00
hid_parser \
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 \
sdp \
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
subdirs:
echo Building all tests
@set -e; \
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir; \
done
clean:
echo Clean all test
@set -e; \
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean; \
done
test:
echo Run all test
@set -e; \
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