mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
fix compile for some of the tests, single Makefile for subset
This commit is contained in:
parent
3df1d63fe3
commit
cbe987fb1e
@ -5,6 +5,7 @@ $ git clone https://github.com/cpputest/cpputest.git
|
|||||||
|
|
||||||
Compile and install
|
Compile and install
|
||||||
$ cd cpputest
|
$ cd cpputest
|
||||||
|
$ ./autogen.sh
|
||||||
$ ./configure
|
$ ./configure
|
||||||
$ make
|
$ make
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
|
@ -5,22 +5,26 @@ CC = g++
|
|||||||
BTSTACK_ROOT = ../..
|
BTSTACK_ROOT = ../..
|
||||||
CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest
|
CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest
|
||||||
|
|
||||||
CFLAGS = -g -Wall -I. -I${BTSTACK_ROOT}/example/libusb -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include -I$(CPPUTEST_HOME)/include
|
CFLAGS = -g -Wall -I.. -I${BTSTACK_ROOT}/example/libusb -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include -I$(CPPUTEST_HOME)/include
|
||||||
LDFLAGS += -L$(CPPUTEST_HOME)/lib -lCppUTest -lCppUTestExt
|
LDFLAGS += -L$(CPPUTEST_HOME)/lib -lCppUTest -lCppUTestExt
|
||||||
|
|
||||||
|
VPATH += ${BTSTACK_ROOT}/ble
|
||||||
|
VPATH += ${BTSTACK_ROOT}/src
|
||||||
|
VPATH += ${BTSTACK_ROOT}/platforms/posix/src
|
||||||
|
|
||||||
COMMON = \
|
COMMON = \
|
||||||
${BTSTACK_ROOT}/src/utils.c \
|
utils.c \
|
||||||
${BTSTACK_ROOT}/src/btstack_memory.c \
|
btstack_memory.c \
|
||||||
${BTSTACK_ROOT}/src/memory_pool.c \
|
memory_pool.c \
|
||||||
${BTSTACK_ROOT}/src/linked_list.c \
|
linked_list.c \
|
||||||
${BTSTACK_ROOT}/src/sdp_util.c \
|
sdp_util.c \
|
||||||
${BTSTACK_ROOT}/src/remote_device_db_memory.c \
|
remote_device_db_memory.c \
|
||||||
${BTSTACK_ROOT}/src/run_loop.c \
|
run_loop.c \
|
||||||
${BTSTACK_ROOT}/src/run_loop_posix.c \
|
run_loop_posix.c \
|
||||||
${BTSTACK_ROOT}/src/hci_cmds.c \
|
hci_cmds.c \
|
||||||
${BTSTACK_ROOT}/src/hci_dump.c \
|
hci_dump.c \
|
||||||
${BTSTACK_ROOT}/src/hci.c \
|
hci.c \
|
||||||
${BTSTACK_ROOT}/ble/ad_parser.c \
|
ad_parser.c \
|
||||||
|
|
||||||
COMMON_OBJ = $(COMMON:.c=.o)
|
COMMON_OBJ = $(COMMON:.c=.o)
|
||||||
|
|
||||||
@ -31,6 +35,6 @@ ad_parser: ${CORE_OBJ} ${COMMON_OBJ} advertising_data_parser.c
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f ad_parser le_central
|
rm -f ad_parser le_central
|
||||||
rm -f *.o ${BTSTACK_ROOT}/src/*.o
|
rm -f *.o
|
||||||
rm -rf *.dSYM
|
rm -rf *.dSYM
|
||||||
|
|
@ -8,20 +8,25 @@ CPPUTEST_HOME = ${BTSTACK_ROOT}/test/cpputest
|
|||||||
CFLAGS = -DUNIT_TEST -x c++ -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include -I$(CPPUTEST_HOME)/include
|
CFLAGS = -DUNIT_TEST -x c++ -g -Wall -I. -I../ -I${BTSTACK_ROOT}/src -I${BTSTACK_ROOT}/ble -I${BTSTACK_ROOT}/include -I$(CPPUTEST_HOME)/include
|
||||||
LDFLAGS += -L$(CPPUTEST_HOME) -lCppUTest -lCppUTestExt
|
LDFLAGS += -L$(CPPUTEST_HOME) -lCppUTest -lCppUTestExt
|
||||||
|
|
||||||
|
VPATH += ${BTSTACK_ROOT}/ble
|
||||||
|
VPATH += ${BTSTACK_ROOT}/src
|
||||||
|
VPATH += ${BTSTACK_ROOT}/platforms/posix/src
|
||||||
|
|
||||||
COMMON = \
|
COMMON = \
|
||||||
${BTSTACK_ROOT}/src/utils.c \
|
utils.c \
|
||||||
${BTSTACK_ROOT}/src/btstack_memory.c \
|
btstack_memory.c \
|
||||||
${BTSTACK_ROOT}/src/memory_pool.c \
|
memory_pool.c \
|
||||||
${BTSTACK_ROOT}/src/linked_list.c \
|
linked_list.c \
|
||||||
${BTSTACK_ROOT}/src/sdp_util.c \
|
sdp_util.c \
|
||||||
${BTSTACK_ROOT}/src/remote_device_db_memory.c \
|
remote_device_db_memory.c \
|
||||||
${BTSTACK_ROOT}/src/hci_cmds.c \
|
hci_cmds.c \
|
||||||
${BTSTACK_ROOT}/src/hci.c \
|
hci.c \
|
||||||
${BTSTACK_ROOT}/src/hci_dump.c \
|
hci_dump.c \
|
||||||
${BTSTACK_ROOT}/ble/att_dispatch.c \
|
att_dispatch.c \
|
||||||
${BTSTACK_ROOT}/ble/att.c \
|
att.c \
|
||||||
${BTSTACK_ROOT}/ble/ad_parser.c \
|
ad_parser.c \
|
||||||
${BTSTACK_ROOT}/ble/gatt_client.c \
|
gatt_client.c \
|
||||||
|
gatt_client_test.c \
|
||||||
mock.c
|
mock.c
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +46,6 @@ le_central: ${CORE_OBJ} ${COMMON_OBJ} le_central.o
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f gatt_client le_central
|
rm -f gatt_client le_central
|
||||||
rm -f *.o ${BTSTACK_ROOT}/src/*.o ${BTSTACK_ROOT}/ble/*.o
|
rm -f *.o *.o ${BTSTACK_ROOT}/ble/*.o
|
||||||
rm -rf *.dSYM
|
rm -rf *.dSYM
|
||||||
|
|
@ -31,16 +31,16 @@ TEST(RemoteDeviceDB, SinglePutGetDeleteKey){
|
|||||||
link_key_t test_link_key;
|
link_key_t test_link_key;
|
||||||
link_key_type_t test_link_key_type;
|
link_key_type_t test_link_key_type;
|
||||||
|
|
||||||
remote_device_db_fs_instance()->delete_link_key(&bd_addr);
|
remote_device_db_fs_instance()->delete_link_key(bd_addr);
|
||||||
CHECK(remote_device_db_fs_instance()->get_link_key(&bd_addr, &test_link_key, &test_link_key_type) == 0);
|
CHECK(remote_device_db_fs_instance()->get_link_key(bd_addr, test_link_key, &test_link_key_type) == 0);
|
||||||
|
|
||||||
remote_device_db_fs_instance()->put_link_key(&bd_addr, &link_key, link_key_type);
|
remote_device_db_fs_instance()->put_link_key(bd_addr, link_key, link_key_type);
|
||||||
CHECK(remote_device_db_fs_instance()->get_link_key(&bd_addr, &test_link_key, &test_link_key_type) == 1);
|
CHECK(remote_device_db_fs_instance()->get_link_key(bd_addr, test_link_key, &test_link_key_type) == 1);
|
||||||
|
|
||||||
CHECK(strcmp(link_key_to_str(link_key), link_key_to_str(test_link_key)) == 0);
|
CHECK(strcmp(link_key_to_str(link_key), link_key_to_str(test_link_key)) == 0);
|
||||||
|
|
||||||
remote_device_db_fs_instance()->delete_link_key(&bd_addr);
|
remote_device_db_fs_instance()->delete_link_key(bd_addr);
|
||||||
CHECK(remote_device_db_fs_instance()->get_link_key(&bd_addr, &test_link_key, &test_link_key_type) == 0);
|
CHECK(remote_device_db_fs_instance()->get_link_key(bd_addr, test_link_key, &test_link_key_type) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,27 +82,27 @@ TEST(RemoteDeviceDB, SortByLastUsedName){
|
|||||||
|
|
||||||
TEST(RemoteDeviceDB, SinglePutGetDeleteKey){
|
TEST(RemoteDeviceDB, SinglePutGetDeleteKey){
|
||||||
sprintf((char*)link_key, "%d", 100);
|
sprintf((char*)link_key, "%d", 100);
|
||||||
remote_device_db_memory.put_link_key(addr1, &link_key, link_key_type);
|
remote_device_db_memory.put_link_key(addr1, link_key, link_key_type);
|
||||||
// dump(db_mem_link_keys);
|
// dump(db_mem_link_keys);
|
||||||
|
|
||||||
CHECK(remote_device_db_memory.get_link_key(addr1, &link_key, &link_key_type));
|
CHECK(remote_device_db_memory.get_link_key(addr1, link_key, &link_key_type));
|
||||||
|
|
||||||
remote_device_db_memory.delete_link_key(addr1);
|
remote_device_db_memory.delete_link_key(addr1);
|
||||||
CHECK(!remote_device_db_memory.get_link_key(addr1, &link_key, &link_key_type));
|
CHECK(!remote_device_db_memory.get_link_key(addr1, link_key, &link_key_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(RemoteDeviceDB, SortByLastUsedKey){
|
TEST(RemoteDeviceDB, SortByLastUsedKey){
|
||||||
sprintf((char*)link_key, "%d", 10);
|
sprintf((char*)link_key, "%d", 10);
|
||||||
remote_device_db_memory.put_link_key(addr1, &link_key, link_key_type);
|
remote_device_db_memory.put_link_key(addr1, link_key, link_key_type);
|
||||||
// dump(db_mem_link_keys);
|
// dump(db_mem_link_keys);
|
||||||
sprintf((char*)link_key, "%d", 20);
|
sprintf((char*)link_key, "%d", 20);
|
||||||
remote_device_db_memory.put_link_key(addr2, &link_key, link_key_type);
|
remote_device_db_memory.put_link_key(addr2, link_key, link_key_type);
|
||||||
// dump(db_mem_link_keys);
|
// dump(db_mem_link_keys);
|
||||||
sprintf((char*)link_key, "%d", 30);
|
sprintf((char*)link_key, "%d", 30);
|
||||||
remote_device_db_memory.put_link_key(addr3, &link_key, link_key_type);
|
remote_device_db_memory.put_link_key(addr3, link_key, link_key_type);
|
||||||
// dump(db_mem_link_keys);
|
// dump(db_mem_link_keys);
|
||||||
|
|
||||||
CHECK(remote_device_db_memory.get_link_key(addr2, &link_key, &link_key_type));
|
CHECK(remote_device_db_memory.get_link_key(addr2, link_key, &link_key_type));
|
||||||
// dump(db_mem_link_keys);
|
// dump(db_mem_link_keys);
|
||||||
|
|
||||||
//get first element of the list
|
//get first element of the list
|
||||||
|
@ -16,7 +16,7 @@ COMMON = \
|
|||||||
${BTSTACK_ROOT}/src/sdp_util.c \
|
${BTSTACK_ROOT}/src/sdp_util.c \
|
||||||
${BTSTACK_ROOT}/src/remote_device_db_memory.c \
|
${BTSTACK_ROOT}/src/remote_device_db_memory.c \
|
||||||
${BTSTACK_ROOT}/src/run_loop.c \
|
${BTSTACK_ROOT}/src/run_loop.c \
|
||||||
${BTSTACK_ROOT}/src/run_loop_posix.c \
|
${BTSTACK_ROOT}/platforms/posix/src/run_loop_posix.c \
|
||||||
${BTSTACK_ROOT}/src/hci_cmds.c \
|
${BTSTACK_ROOT}/src/hci_cmds.c \
|
||||||
${BTSTACK_ROOT}/src/hci_dump.c \
|
${BTSTACK_ROOT}/src/hci_dump.c \
|
||||||
${BTSTACK_ROOT}/ble/sm.c \
|
${BTSTACK_ROOT}/ble/sm.c \
|
||||||
@ -36,6 +36,6 @@ aestest: aestest.c rijndael.c
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f security_manager
|
rm -f security_manager
|
||||||
rm -f *.o ${BTSTACK_ROOT}/src/*.o
|
rm -f *.o
|
||||||
rm -rf *.dSYM
|
rm -rf *.dSYM
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user