2018-10-15 14:32:01 +00:00
|
|
|
CC=g++
|
|
|
|
|
|
|
|
# Requirements: cpputest.github.io
|
|
|
|
|
|
|
|
BTSTACK_ROOT = ../..
|
|
|
|
CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest
|
|
|
|
|
|
|
|
CFLAGS = -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src
|
2020-12-01 21:13:09 +00:00
|
|
|
|
|
|
|
CFLAGS_COVERAGE = ${CFLAGS} -fprofile-arcs -ftest-coverage
|
2021-01-29 20:47:15 +00:00
|
|
|
CFLAGS_ASAN = ${CFLAGS} -fsanitize=address -DHAVE_ASSERT
|
2020-12-01 21:13:09 +00:00
|
|
|
|
2018-10-15 14:32:01 +00:00
|
|
|
LDFLAGS += -lCppUTest -lCppUTestExt
|
2020-12-01 21:13:09 +00:00
|
|
|
LDFLAGS_COVERAGE = ${LDFLAGS} -fprofile-arcs -ftest-coverage
|
|
|
|
LDFLAGS_ASAN = ${LDFLAGS} -fsanitize=address
|
2018-10-15 14:32:01 +00:00
|
|
|
|
|
|
|
VPATH += ${BTSTACK_ROOT}/src
|
|
|
|
|
2020-12-01 21:13:09 +00:00
|
|
|
COMMON = \
|
|
|
|
btstack_base64_decoder.c \
|
|
|
|
btstack_util.c \
|
|
|
|
hci_dump.c \
|
|
|
|
|
|
|
|
COMMON_OBJ_COVERAGE = $(addprefix build-coverage/,$(COMMON:.c=.o))
|
|
|
|
COMMON_OBJ_ASAN = $(addprefix build-asan/, $(COMMON:.c=.o))
|
|
|
|
|
|
|
|
all: build-coverage/base64_decoder_test build-asan/base64_decoder_test
|
2018-10-15 14:32:01 +00:00
|
|
|
|
2020-12-01 21:13:09 +00:00
|
|
|
build-%:
|
|
|
|
mkdir -p $@
|
2018-10-15 14:32:01 +00:00
|
|
|
|
2020-12-01 21:13:09 +00:00
|
|
|
build-coverage/%.o: %.c | build-coverage
|
|
|
|
${CC} -c $(CFLAGS_COVERAGE) $< -o $@
|
2020-11-30 20:35:42 +00:00
|
|
|
|
2020-12-01 21:13:09 +00:00
|
|
|
build-asan/%.o: %.c | build-asan
|
|
|
|
${CC} -c $(CFLAGS_ASAN) $< -o $@
|
|
|
|
|
|
|
|
build-coverage/base64_decoder_test: ${COMMON_OBJ_COVERAGE} build-coverage/base64_decoder_test.o | build-coverage
|
|
|
|
${CC} $^ ${LDFLAGS_COVERAGE} -o $@
|
|
|
|
|
|
|
|
build-asan/base64_decoder_test: ${COMMON_OBJ_ASAN} build-asan/base64_decoder_test.o | build-asan
|
|
|
|
${CC} $^ ${LDFLAGS_ASAN} -o $@
|
2018-10-15 14:32:01 +00:00
|
|
|
|
|
|
|
test: all
|
2020-12-01 21:13:09 +00:00
|
|
|
build-asan/base64_decoder_test
|
2018-10-15 14:32:01 +00:00
|
|
|
|
2020-11-30 20:35:42 +00:00
|
|
|
coverage: all
|
2020-12-01 21:13:09 +00:00
|
|
|
rm -f build-coverage/*.gcda
|
2020-11-30 20:35:42 +00:00
|
|
|
build-coverage/base64_decoder_test
|
|
|
|
|
2018-10-15 14:32:01 +00:00
|
|
|
clean:
|
2020-12-01 21:13:09 +00:00
|
|
|
rm -rf build-coverage build-asan
|