Skip to content

Commit b664735

Browse files
committed
CMake: Refactor event unittest cmake
- Added CMake configuration file into events unittests
1 parent 5ad5179 commit b664735

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

events/tests/UNITTESTS/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(equeue)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2021 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
set(TEST_NAME equeue-unittest)
5+
6+
add_executable(${TEST_NAME})
7+
8+
target_compile_definitions(${TEST_NAME}
9+
PRIVATE
10+
EQUEUE_PLATFORM_POSIX
11+
)
12+
13+
target_compile_options(${TEST_NAME}
14+
PRIVATE
15+
"-pthread"
16+
)
17+
18+
target_sources(${TEST_NAME}
19+
PRIVATE
20+
${mbed-os_SOURCE_DIR}/events/source/equeue.c
21+
test_equeue.cpp
22+
)
23+
24+
target_link_libraries(${TEST_NAME}
25+
PRIVATE
26+
mbed-headers
27+
mbed-stubs-events
28+
mbed-stubs-platform
29+
gmock_main
30+
)
31+
32+
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME})
33+
34+
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "equeue")

0 commit comments

Comments
 (0)