Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ble stubs to FEATURE_BLE lib #14912

Merged
merged 5 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions UNITTESTS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,3 @@ if (VALGRIND)
endif(VALGRIND)

add_subdirectory(stubs)
add_subdirectory(fakes)

4 changes: 0 additions & 4 deletions UNITTESTS/fakes/CMakeLists.txt

This file was deleted.

8 changes: 0 additions & 8 deletions UNITTESTS/stubs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
add_library(mbed-stubs-headers INTERFACE)
add_library(mbed-headers INTERFACE)
add_library(mbed-headers-base INTERFACE)
add_library(mbed-headers-connectivity INTERFACE)

target_link_libraries(mbed-headers
INTERFACE
mbed-headers-base
mbed-headers-platform
mbed-headers-connectivity
mbed-headers-drivers
mbed-headers-hal
mbed-headers-events
Expand All @@ -28,12 +26,6 @@ target_include_directories(mbed-headers-base
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/sys
)

target_include_directories(mbed-headers-connectivity
INTERFACE
${mbed-os_SOURCE_DIR}/connectivity
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/include
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/include/ble
)

target_include_directories(mbed-headers
INTERFACE
Expand Down
1 change: 1 addition & 0 deletions connectivity/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ else()
add_subdirectory(netsocket)
add_subdirectory(mbedtls)
add_subdirectory(libraries)
add_subdirectory(FEATURE_BLE)
endif()
4 changes: 4 additions & 0 deletions connectivity/FEATURE_BLE/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(tests/UNITTESTS)
endif()

add_subdirectory(libraries)
add_subdirectory(source)

Expand Down
1 change: 1 addition & 0 deletions connectivity/FEATURE_BLE/tests/UNITTESTS/.mbedignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
3 changes: 3 additions & 0 deletions connectivity/FEATURE_BLE/tests/UNITTESTS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
add_subdirectory(doubles)
12 changes: 12 additions & 0 deletions connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(fakes)

add_library(mbed-headers-feature-ble INTERFACE)

target_include_directories(mbed-headers-feature-ble
INTERFACE
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/include
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/include/ble
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_library(mbed-fakes-ble)

target_include_directories(mbed-fakes-ble
PUBLIC
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/include
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/include/ble
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/source
Expand All @@ -24,18 +24,19 @@ target_sources(mbed-fakes-ble
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/source/GattClient.cpp
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/source/GattServer.cpp
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/source/SecurityManager.cpp
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/BLE.cpp
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/source/GattServerImpl_mock.cpp
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/ble_mocks.h
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/GapImpl_mock.h
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/GattClientImpl_mock.h
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/GattServerImpl_mock.h
${mbed-os_SOURCE_DIR}/UNITTESTS/fakes/ble/SecurityManagerImpl_mock.h
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/BLE.cpp
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/source/GattServerImpl_mock.cpp
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/ble_mocks.h
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/GapImpl_mock.h
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/GattClientImpl_mock.h
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/GattServerImpl_mock.h
${mbed-os_SOURCE_DIR}/connectivity/FEATURE_BLE/tests/UNITTESTS/doubles/fakes/SecurityManagerImpl_mock.h
)

target_link_libraries(mbed-fakes-ble
PRIVATE
mbed-headers
mbed-stubs-headers
mbed-headers-base
mbed-headers-platform
mbed-headers-events
gcov
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2021 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* mbed Microcontroller Library
* Copyright (c) 2020 ARM Limited
* SPDX-License-Identifier: Apache-2.0
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -27,7 +27,7 @@ class SecurityManager {
SecurityManager(const SecurityManager&) = delete;
SecurityManager& operator=(const SecurityManager&) = delete;
virtual ~SecurityManager() {};

using SecurityIOCapabilities_t = ble::SecurityManager::SecurityIOCapabilities_t;
using SecurityMode_t = ble::SecurityManager::SecurityMode_t;
using SecurityManagerShutdownCallback_t = ble::SecurityManager::SecurityManagerShutdownCallback_t;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ target_sources(mbed-stubs-cellular
target_link_libraries(mbed-stubs-cellular
PRIVATE
mbed-headers-base
mbed-headers-connectivity
mbed-stubs-platform
mbed-headers-rtos
mbed-headers-drivers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ add_library(mbed-headers-lorawan INTERFACE)

target_include_directories(mbed-headers-lorawan
INTERFACE
${mbed-os_SOURCE_DIR}/connectivity
${mbed-os_SOURCE_DIR}/connectivity/lorawan/include/lorawan
${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack
${mbed-os_SOURCE_DIR}/connectivity/lorawan/lorastack/mac
Expand Down Expand Up @@ -43,7 +44,6 @@ target_link_libraries(mbed-stubs-lorawan
mbed-headers-events
mbed-headers-hal
mbed-stubs-headers
mbed-headers-connectivity
mbed-headers-platform
mbed-headers-lorawan
mbed-headers-mbedtls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ target_link_libraries(${TEST_NAME}
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
mbed-headers-connectivity
mbed-headers-mbedtls
mbed-headers-lorawan
mbed-stubs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_link_libraries(${TEST_NAME}
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-connectivity
mbed-headers-platform
mbed-headers-mbedtls
mbed-headers-lorawan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ target_sources(${TEST_NAME}
target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-connectivity
mbed-headers-platform
mbed-headers-mbedtls
mbed-headers-lorawan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_link_libraries(${TEST_NAME}
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-connectivity
mbed-headers-platform
mbed-headers-cellular
mbed-headers-mbedtls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ target_link_libraries(${TEST_NAME}
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-connectivity
mbed-headers-platform
mbed-headers-mbedtls
mbed-headers-lorawan
Expand Down