2015-05-17 18:07:24 +02:00
|
|
|
|
|
|
|
# Makefile to build and run all tests
|
|
|
|
|
|
|
|
SUBDIRS = \
|
2020-09-25 18:45:10 +02:00
|
|
|
ad_parser \
|
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 \
|
2020-09-28 11:59:13 +02:00
|
|
|
btstack_memory \
|
2019-09-14 22:36:27 +02:00
|
|
|
crypto \
|
2015-05-17 18:07:24 +02:00
|
|
|
des_iterator \
|
2019-09-18 13:13:05 +02:00
|
|
|
flash_tlv \
|
2020-04-02 16:22:07 +02:00
|
|
|
gap \
|
2020-09-24 16:10:42 +02:00
|
|
|
gatt_client \
|
|
|
|
gatt_server \
|
2020-09-25 11:36:49 +02:00
|
|
|
gatt_service \
|
2015-08-20 17:06:54 +02:00
|
|
|
hfp \
|
2019-09-14 22:36:27 +02:00
|
|
|
hid_parser \
|
2020-09-24 14:41:36 +02:00
|
|
|
le_device_db_tlv \
|
2020-09-24 16:10:42 +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 \
|
2020-11-18 11:49:50 +01:00
|
|
|
pts \
|
2019-09-14 22:36:27 +02:00
|
|
|
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 \
|
2020-10-30 14:22:37 +01:00
|
|
|
embedded \
|
2020-09-23 15:16:14 +02:00
|
|
|
|
2019-09-23 14:01:17 +02:00
|
|
|
# not testing anything in source tree
|
|
|
|
# maths \
|
2020-09-18 17:53:30 +02:00
|
|
|
# no unit tests
|
|
|
|
# embedded \
|
|
|
|
# gatt_server \
|
2020-09-24 10:48:12 +02:00
|
|
|
# mixes classic with ble
|
|
|
|
# flash_tlv - contains btstack_linked_key_db tests
|
|
|
|
# hangs on buildbot (no output for 20 minutes -> abort)
|
|
|
|
# security_manager_sc
|
2020-08-31 13:56:51 +02:00
|
|
|
|
|
|
|
SUBDIRS_BLE = \
|
2020-09-25 18:45:10 +02:00
|
|
|
ad_parser \
|
2020-08-31 13:56:51 +02:00
|
|
|
att_db \
|
|
|
|
ble_client \
|
2020-09-28 11:59:13 +02:00
|
|
|
btstack_memory \
|
2020-08-31 13:56:51 +02:00
|
|
|
crypto \
|
2021-01-28 15:52:10 +01:00
|
|
|
embedded \
|
2020-08-31 13:56:51 +02:00
|
|
|
gap \
|
2020-09-24 16:10:42 +02:00
|
|
|
gatt_client \
|
2021-01-26 10:53:31 +01:00
|
|
|
gatt_server \
|
2020-09-25 11:36:49 +02:00
|
|
|
gatt_service \
|
2020-08-31 13:56:51 +02:00
|
|
|
hid_parser \
|
2020-09-24 14:41:36 +02:00
|
|
|
le_device_db_tlv \
|
2020-08-31 13:56:51 +02:00
|
|
|
linked_list \
|
|
|
|
ring_buffer \
|
2020-09-24 16:10:42 +02:00
|
|
|
gatt_server \
|
2020-09-24 15:27:45 +02:00
|
|
|
security_manager \
|
2021-01-28 19:21:15 +01:00
|
|
|
|
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 \
|
2020-09-18 17:58:27 +02:00
|
|
|
# gatt_server \
|
|
|
|
|
2020-09-24 17:35:11 +02:00
|
|
|
.PHONY: coverage coverage-sm-sc.info coverage-pts.info
|
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
|
|
|
|
|
2020-12-01 12:17:40 +01:00
|
|
|
subdirs-coverage:
|
|
|
|
echo Run all tests for coverage
|
|
|
|
@set -e; \
|
|
|
|
for dir in $(SUBDIRS); do \
|
|
|
|
$(MAKE) -C $$dir coverage; \
|
|
|
|
done
|
|
|
|
|
|
|
|
subdirs-coverage-ble:
|
|
|
|
echo Run all BLE tests for coverage
|
|
|
|
@set -e; \
|
|
|
|
for dir in $(SUBDIRS_BLE); do \
|
|
|
|
$(MAKE) -C $$dir coverage; \
|
|
|
|
done
|
|
|
|
|
2020-09-24 11:22:52 +02:00
|
|
|
|
|
|
|
coverage-pts.info:
|
|
|
|
# download pts coverage and fix paths
|
2020-09-24 11:34:58 +02:00
|
|
|
curl https://bluekitchen-gmbh.com/btstack/develop/coverage-pts.info | sed "s|/Users/mringwal/buildbot-worker/auto-pts/btstack|`realpath ..`|" > coverage-pts.info
|
2020-09-24 11:22:52 +02:00
|
|
|
|
2020-09-24 17:12:40 +02:00
|
|
|
coverage-sm-sc.info:
|
|
|
|
# download pts coverage and fix paths
|
2020-10-29 16:30:19 +01:00
|
|
|
curl https://bluekitchen-gmbh.com/btstack/develop/coverage-sm-sc.info | sed "s|/Users/mringwal/buildbot-worker/test-develop-sm-sc/build|`realpath ..`|" > coverage-sm-sc.info
|
2020-09-24 17:12:40 +02:00
|
|
|
|
2020-09-24 11:22:52 +02:00
|
|
|
|
2021-01-29 21:46:21 +01:00
|
|
|
coverage-unit.info: subdirs-coverage
|
2019-09-23 14:01:17 +02:00
|
|
|
# delete trace data
|
|
|
|
find . -name "*.gcda" -type f -delete
|
|
|
|
# run tests
|
2020-12-01 12:17:40 +01:00
|
|
|
$(MAKE) subdirs-coverage
|
2020-08-31 13:56:51 +02:00
|
|
|
# collect traces
|
2020-09-24 11:22:52 +02:00
|
|
|
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/test/*" --output-file coverage-unit.info
|
2020-09-21 12:04:18 +02:00
|
|
|
# demangle
|
2020-09-24 11:22:52 +02:00
|
|
|
python3 coverage_demangle.py coverage-unit.info
|
2020-08-31 13:56:51 +02:00
|
|
|
|
2021-01-29 21:46:21 +01:00
|
|
|
coverage-unit-ble.info: subdirs-coverage-ble
|
2020-08-31 13:56:51 +02:00
|
|
|
# delete trace data
|
|
|
|
find . -name "*.gcda" -type f -delete
|
|
|
|
# run tests
|
2020-12-01 12:17:40 +01:00
|
|
|
$(MAKE) subdirs-coverage-ble
|
2019-09-23 14:01:17 +02:00
|
|
|
# collect traces
|
2020-09-24 11:22:52 +02:00
|
|
|
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/test/*" --output-file coverage-unit-ble.info
|
2020-09-21 12:04:18 +02:00
|
|
|
# demangle
|
2020-09-24 11:22:52 +02:00
|
|
|
python3 coverage_demangle.py coverage-unit-ble.info
|
2020-08-28 23:38:06 +02:00
|
|
|
|
|
|
|
|
2020-09-24 17:12:40 +02:00
|
|
|
coverage-ble.info: coverage-pts.info coverage-sm-sc.info coverage-unit-ble.info
|
2020-09-24 11:22:52 +02:00
|
|
|
# combine unit-ble and pts
|
2020-09-24 17:12:40 +02:00
|
|
|
lcov --rc lcov_branch_coverage=1 -a coverage-pts.info -a coverage-sm-sc.info -a coverage-unit-ble.info --output-file coverage-ble.info
|
2020-08-28 23:38:06 +02:00
|
|
|
|
2020-09-24 11:22:52 +02:00
|
|
|
|
|
|
|
coverage-bat.info: coverage-ble.info
|
2020-08-31 13:56:51 +02:00
|
|
|
# create bat subset from ble subset
|
2020-09-24 17:12:40 +02:00
|
|
|
./coverage_subset_bat.py coverage-ble.info coverage-bat.info
|
2020-08-28 23:38:06 +02:00
|
|
|
|
2020-09-21 12:04:18 +02:00
|
|
|
|
2020-09-24 17:12:40 +02:00
|
|
|
coverage.info: coverage-pts.info coverage-sm-sc.info coverage-unit.info
|
2020-09-24 11:22:52 +02:00
|
|
|
# combine unit-ble and pts
|
2020-09-24 17:12:40 +02:00
|
|
|
lcov --rc lcov_branch_coverage=1 -a coverage-pts.info -a coverage-sm-sc.info -a coverage-unit.info --output-file coverage.info
|
2020-09-24 11:22:52 +02:00
|
|
|
|
|
|
|
|
|
|
|
coverage-all: coverage.info
|
2019-09-23 14:01:17 +02:00
|
|
|
# generate html output
|
2020-09-24 11:22:52 +02:00
|
|
|
genhtml coverage.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage
|
|
|
|
|
|
|
|
coverage-bat: coverage-bat.info
|
|
|
|
# generate html output
|
|
|
|
genhtml coverage-bat.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage-bat
|
|
|
|
|
|
|
|
coverage-ble: coverage-ble.info
|
|
|
|
# generate html output
|
|
|
|
genhtml coverage-ble.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage-ble
|
|
|
|
|
2020-09-25 10:50:02 +02:00
|
|
|
coverage-unit-ble: coverage-unit-ble.info
|
|
|
|
# generate html output
|
|
|
|
genhtml coverage-unit-ble.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage-unit-ble
|
2020-09-24 11:22:52 +02:00
|
|
|
|
2020-09-25 17:59:04 +02:00
|
|
|
coverage-sm-sc: coverage-sm-sc.info
|
|
|
|
# generate html output
|
|
|
|
genhtml coverage-sm-sc.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage-sm-sc
|
|
|
|
|
2021-01-29 21:46:21 +01:00
|
|
|
coverage-pts: coverage-pts.info
|
|
|
|
# generate html output
|
|
|
|
genhtml coverage-pts.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage-pts
|
|
|
|
|
2020-09-24 11:22:52 +02:00
|
|
|
coverage: coverage-all coverage-ble coverage-bat
|
2021-02-03 10:53:23 +01:00
|
|
|
|
|
|
|
test:
|
|
|
|
echo Run all tests with ASAN
|
|
|
|
@set -e; \
|
|
|
|
for dir in $(SUBDIRS); do \
|
|
|
|
$(MAKE) -C $$dir test; \
|
|
|
|
done
|
|
|
|
|
|
|
|
test-ble:
|
|
|
|
echo Run all BLE tests with ASAN
|
|
|
|
@set -e; \
|
|
|
|
for dir in $(SUBDIRS_BLE); do \
|
|
|
|
$(MAKE) -C $$dir test; \
|
|
|
|
done
|