btstack/test/Makefile

148 lines
2.9 KiB
Makefile
Raw Normal View History

# Makefile to build and run all tests
SUBDIRS = \
ad_parser \
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 \
2020-09-28 11:59:13 +02:00
btstack_memory \
classic-oob-pairing \
2019-09-14 22:36:27 +02:00
crypto \
des_iterator \
embedded \
flash_tlv \
gap \
gatt-service-client \
gatt_client \
gatt_server \
gatt_service_server \
2015-08-20 17:06:54 +02:00
hfp \
2019-09-14 22:36:27 +02:00
hid_parser \
l2cap-cbm \
l2cap-ecbm \
le_device_db_tlv \
linked_list \
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 \
2020-09-18 17:53:30 +02:00
# no unit tests
# embedded \
# gatt_server \
# mixes classic with ble
# flash_tlv - contains btstack_linked_key_db tests
# hangs on buildbot (no output for 20 minutes -> abort)
# security_manager_sc
SUBDIRS_BLE = \
ad_parser \
att_db \
ble_client \
2020-09-28 11:59:13 +02:00
btstack_memory \
crypto \
2021-01-28 15:52:10 +01:00
embedded \
gap \
gatt-service-client \
gatt_client \
2021-01-26 10:53:31 +01:00
gatt_server \
gatt_service_server \
hid_parser \
l2cap-cbm \
le_device_db_tlv \
linked_list \
ring_buffer \
security_manager \
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 \
2022-11-23 16:27:47 +01:00
.PHONY: coverage coverage-sm-sc.info
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
2023-02-12 17:55:00 +01:00
rm -f *.info
rm -rf coverage coverage-unit-ble
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
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
# collect traces
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/test/*" --output-file coverage-unit.info
2021-01-29 21:46:21 +01:00
coverage-unit-ble.info: subdirs-coverage-ble
# 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
lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/test/*" --output-file coverage-unit-ble.info
2020-08-28 23:38:06 +02:00
2023-02-12 17:13:35 +01:00
coverage-all: coverage-unit.info
# generate html output
2023-02-12 17:13:35 +01:00
genhtml coverage-unit.info --branch-coverage --demangle-cpp --config-file lcovrc --output-directory coverage
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
2023-02-12 17:13:35 +01:00
coverage: coverage-all coverage-unit-ble
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