From e8a62bb7728fe11a7e70e1ce74e5bb7dfde4485b Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 24 Sep 2020 15:50:44 +0200 Subject: [PATCH] test/security_manager_sc: collect traces locally --- test/security_manager_sc/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/security_manager_sc/Makefile b/test/security_manager_sc/Makefile index 9ad5f2712..c2244fda1 100644 --- a/test/security_manager_sc/Makefile +++ b/test/security_manager_sc/Makefile @@ -81,6 +81,8 @@ GATT_SERVER_OBJ = $(GATT_SERVER:.c=.o) %.h: %.gatt python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@ +.PHONY: all coverage test + all: sm_test sm_test: sm_test.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ${SM_OBJ} sm_test.o @@ -98,3 +100,13 @@ clean: myclean test: sm_test rm -rf SM_* python3 ./sm_test.py + +coverage: sm_test + # delete trace data + find . -name "*.gcda" -type f -delete + # run tests + make test + # collect traces + lcov --capture --rc lcov_branch_coverage=1 --directory . --exclude "/Applications/*" --exclude "/Library/*" --exclude "/usr/*" --exclude "*/test/*" --output-file security_manager_sc.info + # demangle + python3 ../coverage_demangle.py security_manager_sc.info