Skip to content

Commit 5ad5179

Browse files
committed
CMake: Refactor platform unittest CMake
- Add CMake configuration file test suites
1 parent 98215d3 commit 5ad5179

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
set(TEST_NAME atcmdparser-unittest)
5+
6+
add_executable(${TEST_NAME})
7+
8+
target_sources(${TEST_NAME}
9+
PRIVATE
10+
${mbed-os_SOURCE_DIR}/platform/source/ATCmdParser.cpp
11+
test_ATCmdParser.cpp
12+
)
13+
14+
target_link_libraries(${TEST_NAME}
15+
PRIVATE
16+
mbed-headers
17+
mbed-stubs-headers
18+
mbed-stubs-platform
19+
gmock_main
20+
)
21+
22+
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME})
23+
24+
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "platform")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(ATCmdParser)
5+
add_subdirectory(CircularBuffer)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
set(TEST_NAME circularbuffer-unittest)
5+
6+
add_executable(${TEST_NAME})
7+
8+
target_sources(${TEST_NAME}
9+
PRIVATE
10+
test_CircularBuffer.cpp
11+
)
12+
13+
target_link_libraries(${TEST_NAME}
14+
PRIVATE
15+
mbed-headers
16+
mbed-stubs-platform
17+
gmock_main
18+
)
19+
20+
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME})
21+
22+
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "platform")

0 commit comments

Comments
 (0)