From ccc4a51891a306aafe4c54fe343bde46ba1f3096 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 7 Jan 2020 11:26:31 +0100 Subject: [PATCH] test: add -fanitize=address,undefined to most tests --- test/att_db/Makefile | 2 +- test/avdtp_util/Makefile | 2 +- test/base64/Makefile | 2 +- test/btstack_link_key_db/Makefile | 2 +- test/des_iterator/Makefile | 2 +- test/embedded/Makefile | 2 +- test/flash_tlv/Makefile | 2 +- test/gatt_server/Makefile | 2 +- test/hid_parser/Makefile | 2 +- test/obex/Makefile | 2 +- test/ring_buffer/Makefile | 2 +- test/sdp/Makefile | 2 +- test/sdp_client/Makefile | 2 +- test/security_manager/Makefile | 2 +- test/tlv_posix/Makefile | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/att_db/Makefile b/test/att_db/Makefile index 9d1e2aa4d..f6ac0f820 100644 --- a/test/att_db/Makefile +++ b/test/att_db/Makefile @@ -8,7 +8,7 @@ CFLAGS = -g -Wall \ -I.. \ -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address LDFLAGS += -lCppUTest -lCppUTestExt diff --git a/test/avdtp_util/Makefile b/test/avdtp_util/Makefile index 80606a9e7..18ad1ddda 100644 --- a/test/avdtp_util/Makefile +++ b/test/avdtp_util/Makefile @@ -8,7 +8,7 @@ CFLAGS = -g -Wall \ -I.. \ -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt diff --git a/test/base64/Makefile b/test/base64/Makefile index 55803d8cd..3de7de3aa 100644 --- a/test/base64/Makefile +++ b/test/base64/Makefile @@ -6,7 +6,7 @@ BTSTACK_ROOT = ../.. CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest CFLAGS = -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src diff --git a/test/btstack_link_key_db/Makefile b/test/btstack_link_key_db/Makefile index 6811daf76..4c9ae53ce 100644 --- a/test/btstack_link_key_db/Makefile +++ b/test/btstack_link_key_db/Makefile @@ -11,7 +11,7 @@ CFLAGS = -g -Wall \ -I${BTSTACK_ROOT}/src \ -I${BTSTACK_ROOT}/platform/posix \ -I${BTSTACK_ROOT}/3rd-party/tinydir -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt diff --git a/test/des_iterator/Makefile b/test/des_iterator/Makefile index 4e62169c5..6bac1ee9a 100644 --- a/test/des_iterator/Makefile +++ b/test/des_iterator/Makefile @@ -5,7 +5,7 @@ CC = g++ BTSTACK_ROOT = ../.. CFLAGS = -g -Wall -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src diff --git a/test/embedded/Makefile b/test/embedded/Makefile index 9e924c845..2ad5ea60e 100644 --- a/test/embedded/Makefile +++ b/test/embedded/Makefile @@ -10,7 +10,7 @@ CFLAGS = -g -Wall \ -I${BTSTACK_ROOT}/src \ -I${BTSTACK_ROOT}/platform/embedded -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined CFLAGS += -DHAVE_HAL_AUDIO diff --git a/test/flash_tlv/Makefile b/test/flash_tlv/Makefile index a66db2848..998bf8478 100644 --- a/test/flash_tlv/Makefile +++ b/test/flash_tlv/Makefile @@ -26,7 +26,7 @@ CFLAGS = \ -I${BTSTACK_ROOT}/src \ -I${BTSTACK_ROOT}/platform/embedded \ -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt TESTS = tlv_test tlv_le_test diff --git a/test/gatt_server/Makefile b/test/gatt_server/Makefile index 23eb996b7..ec30bff43 100644 --- a/test/gatt_server/Makefile +++ b/test/gatt_server/Makefile @@ -5,7 +5,7 @@ CC = g++ BTSTACK_ROOT = ../.. CFLAGS = -DUNIT_TEST -x c++ -g -Wall -Wnarrowing -Wconversion-null -I. -I../ -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src diff --git a/test/hid_parser/Makefile b/test/hid_parser/Makefile index 94a68f3ee..7da8f3dfa 100644 --- a/test/hid_parser/Makefile +++ b/test/hid_parser/Makefile @@ -8,7 +8,7 @@ CPPFLAGS = -x c++ -Wall -Wno-unused CFLAGS = -DUNIT_TEST -g CFLAGS += -I. -I.. -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src diff --git a/test/obex/Makefile b/test/obex/Makefile index c5facafc0..be5e8eede 100644 --- a/test/obex/Makefile +++ b/test/obex/Makefile @@ -6,7 +6,7 @@ BTSTACK_ROOT = ../.. CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest CFLAGS = -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/include -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src/ble diff --git a/test/ring_buffer/Makefile b/test/ring_buffer/Makefile index 05bc3826b..f18f3dd0a 100644 --- a/test/ring_buffer/Makefile +++ b/test/ring_buffer/Makefile @@ -6,7 +6,7 @@ BTSTACK_ROOT = ../.. CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest CFLAGS = -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src diff --git a/test/sdp/Makefile b/test/sdp/Makefile index ad030fbf8..23a09a038 100644 --- a/test/sdp/Makefile +++ b/test/sdp/Makefile @@ -8,7 +8,7 @@ CFLAGS = -g -Wall \ -I.. \ -I${BTSTACK_ROOT}/src \ -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt diff --git a/test/sdp_client/Makefile b/test/sdp_client/Makefile index 34d4c0203..434e8edce 100644 --- a/test/sdp_client/Makefile +++ b/test/sdp_client/Makefile @@ -6,7 +6,7 @@ BTSTACK_ROOT = ../.. CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest CFLAGS = -g -Wall -I.. -I${BTSTACK_ROOT}/src -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt # -L$(CPPUTEST_HOME) diff --git a/test/security_manager/Makefile b/test/security_manager/Makefile index 255dba43d..dcd582fa7 100644 --- a/test/security_manager/Makefile +++ b/test/security_manager/Makefile @@ -10,7 +10,7 @@ CFLAGS += -I. -I.. -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/platform/posix CFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include CFLAGS += -I${BTSTACK_ROOT}/3rd-party/micro-ecc CFLAGS += -I${BTSTACK_ROOT}/3rd-party/rijndael -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt VPATH += ${BTSTACK_ROOT}/src diff --git a/test/tlv_posix/Makefile b/test/tlv_posix/Makefile index 5ff8b2ae9..2e3e68b02 100644 --- a/test/tlv_posix/Makefile +++ b/test/tlv_posix/Makefile @@ -25,7 +25,7 @@ CFLAGS = \ -I${BTSTACK_ROOT}/src \ -I${BTSTACK_ROOT}/platform/posix \ -CFLAGS += -fprofile-arcs -ftest-coverage +CFLAGS += -fprofile-arcs -ftest-coverage -fsanitize=address,undefined LDFLAGS += -lCppUTest -lCppUTestExt TESTS = tlv_test