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

Unit tests: Move target_h/ stubs into libraries' test doubles #14929

Merged
merged 17 commits into from
Aug 3, 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: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ matrix:
- >-
git diff --name-only --diff-filter=d FETCH_HEAD..HEAD \
| ( grep '.*[\\|\/]PinNames.h$' || true ) \
| while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vfp "${file}"; done
| while read file; do python ./hal/tests/pinvalidate/pinvalidate.py -vvvfp "${file}"; done
- git diff --exit-code --diff-filter=d --color

### CMake Check ###
Expand Down
14 changes: 0 additions & 14 deletions UNITTESTS/stubs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,16 @@

add_library(mbed-stubs-headers INTERFACE)
add_library(mbed-headers INTERFACE)
add_library(mbed-headers-base INTERFACE)

target_link_libraries(mbed-headers
INTERFACE
mbed-headers-base
mbed-headers-platform
mbed-headers-drivers
mbed-headers-hal
mbed-headers-events
mbed-headers-rtos
)

target_include_directories(mbed-headers-base
INTERFACE
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/platform
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/platform/cxxsupport
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/drivers
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/rtos/include
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/rtos
${mbed-os_SOURCE_DIR}/UNITTESTS/target_h/sys
)


target_include_directories(mbed-headers
INTERFACE
${mbed-os_SOURCE_DIR}/features
Expand Down
16 changes: 0 additions & 16 deletions UNITTESTS/target_h/arm_math.h

This file was deleted.

34 changes: 0 additions & 34 deletions UNITTESTS/target_h/mbed.h

This file was deleted.

16 changes: 0 additions & 16 deletions UNITTESTS/target_h/nsapi_ppp.h

This file was deleted.

17 changes: 0 additions & 17 deletions UNITTESTS/target_h/sys/syslimits.h

This file was deleted.

3 changes: 3 additions & 0 deletions cmsis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
add_subdirectory(CMSIS_5)
add_subdirectory(device)

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(tests/UNITTESTS/doubles)
endif()
1 change: 1 addition & 0 deletions cmsis/tests/UNITTESTS/.mbedignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
9 changes: 9 additions & 0 deletions cmsis/tests/UNITTESTS/doubles/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2021 Arm Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_library(mbed-headers-cmsis INTERFACE)

target_include_directories(mbed-headers-cmsis
INTERFACE
.
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ target_sources(mbed-stubs-cellular

target_link_libraries(mbed-stubs-cellular
PRIVATE
mbed-headers-base
mbed-stubs-platform
mbed-headers-rtos
mbed-headers-drivers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class myCellularContext : public CellularContext {
return true;
};

const char* get_nonip_context_type_str() {
const char *get_nonip_context_type_str()
{
return "Non-IP";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-events
mbed-headers-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ target_sources(mbed-stubs-lorawan

target_link_libraries(mbed-stubs-lorawan
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-stubs-headers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-platform
mbed-headers-mbedtls
mbed-headers-lorawan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-hal
mbed-headers-platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ target_sources(${TEST_NAME}

target_link_libraries(${TEST_NAME}
PRIVATE
mbed-headers-base
mbed-headers-events
mbed-headers-platform
mbed-headers-lorawan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "netsocket/NetworkStack.h"
#include "netsocket/nsapi_dns.h"
#include "mbed.h"
#include "stddef.h"
#include <new>

Expand Down
Loading