mirror of https://github.com/ARMmbed/mbed-os.git
CMake: Refactor storage TDBstore and FileSystemStore unittest cmake
- Add CMake configuration file in TDBstore and FileSystemStore unittest.pull/14426/head
parent
2bafdf82e7
commit
c0a8fe62f5
|
@ -0,0 +1,4 @@
|
||||||
|
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
add_subdirectory(FileSystemStore)
|
|
@ -0,0 +1,43 @@
|
||||||
|
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
set(TEST_NAME filesystemstore-unittest)
|
||||||
|
|
||||||
|
add_executable(${TEST_NAME})
|
||||||
|
|
||||||
|
target_compile_definitions(${TEST_NAME}
|
||||||
|
PRIVATE
|
||||||
|
UNITTEST
|
||||||
|
MBED_LFS_READ_SIZE=64
|
||||||
|
MBED_LFS_PROG_SIZE=64
|
||||||
|
MBED_LFS_BLOCK_SIZE=512
|
||||||
|
MBED_LFS_LOOKAHEAD=512
|
||||||
|
)
|
||||||
|
|
||||||
|
target_sources(${TEST_NAME}
|
||||||
|
PRIVATE
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/blockdevice/source/HeapBlockDevice.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/kvstore/filesystemstore/source/FileSystemStore.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefs/source/LittleFileSystem.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/filesystem/source/Dir.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/filesystem/source/File.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/filesystem/source/FileSystem.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/platform/mbed-trace/source/mbed_trace.c
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/filesystem/littlefs/littlefs/lfs.c
|
||||||
|
${mbed-os_SOURCE_DIR}/platform/source/FileBase.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/platform/source/FileSystemHandle.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/platform/source/FileHandle.cpp
|
||||||
|
moduletest.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${TEST_NAME}
|
||||||
|
PRIVATE
|
||||||
|
mbed-headers
|
||||||
|
mbed-stubs-platform
|
||||||
|
mbed-stubs-storage
|
||||||
|
gmock_main
|
||||||
|
)
|
||||||
|
|
||||||
|
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME})
|
||||||
|
|
||||||
|
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "storage")
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
add_subdirectory(TDBStore)
|
|
@ -0,0 +1,30 @@
|
||||||
|
# Copyright (c) 2021 ARM Limited. All rights reserved.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
set(TEST_NAME tdbstore-unittest)
|
||||||
|
|
||||||
|
add_executable(${TEST_NAME})
|
||||||
|
|
||||||
|
target_compile_definitions(${TEST_NAME}
|
||||||
|
PRIVATE
|
||||||
|
UNITTEST
|
||||||
|
)
|
||||||
|
|
||||||
|
target_sources(${TEST_NAME}
|
||||||
|
PRIVATE
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/blockdevice/source/HeapBlockDevice.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/blockdevice/source/BufferedBlockDevice.cpp
|
||||||
|
${mbed-os_SOURCE_DIR}/storage/kvstore/tdbstore/source/TDBStore.cpp
|
||||||
|
moduletest.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${TEST_NAME}
|
||||||
|
PRIVATE
|
||||||
|
mbed-headers
|
||||||
|
mbed-stubs-platform
|
||||||
|
gmock_main
|
||||||
|
)
|
||||||
|
|
||||||
|
add_test(NAME "${TEST_NAME}" COMMAND ${TEST_NAME})
|
||||||
|
|
||||||
|
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "storage")
|
Loading…
Reference in New Issue