1CC=g++ 2 3BTSTACK_ROOT = ../.. 4CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest 5 6COMMON_OBJ = \ 7 btstack_tlv_posix.o \ 8 btstack_util.o \ 9 btstack_linked_list.o \ 10 hci_dump.o \ 11 12VPATH = \ 13 ${BTSTACK_ROOT}/src \ 14 ${BTSTACK_ROOT}/src/classic \ 15 ${BTSTACK_ROOT}/src/ble \ 16 ${BTSTACK_ROOT}/platform/posix \ 17 18CFLAGS = \ 19 -DBTSTACK_TEST \ 20 -g \ 21 -Wall \ 22 -Wnarrowing \ 23 -I. \ 24 -I.. \ 25 -I${BTSTACK_ROOT}/src \ 26 -I${BTSTACK_ROOT}/platform/posix \ 27 28CFLAGS += -fprofile-arcs -ftest-coverage 29LDFLAGS += -lCppUTest -lCppUTestExt 30 31TESTS = tlv_test 32 33all: ${TESTS} 34 35clean: 36 rm -rf *.o $(TESTS) *.dSYM *.pklg 37 rm -f *.gcno *.gcda 38 39tlv_test: ${COMMON_OBJ} tlv_test.o 40 ${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@ 41 42test: all 43 @echo Run all test 44 @set -e; \ 45 for test in $(TESTS); do \ 46 ASAN_OPTIONS=detect_leaks=0 ./$$test; \ 47 done 48 49