Add google test for testing the library.
This commit is contained in:
19
test/CMakeLists.txt
Normal file
19
test/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
project(MiniFFSTests)
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
include_directories(../includes)
|
||||
link_libraries(miniffs)
|
||||
|
||||
set(TESTS_SRC fs_opening.cpp)
|
||||
|
||||
add_executable(miniffs_test)
|
||||
target_include_directories(miniffs_test PUBLIC ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
|
||||
target_sources(miniffs_test PRIVATE ${TESTS_SRC})
|
||||
target_link_libraries(miniffs_test gtest gtest_main Threads::Threads)
|
||||
|
||||
gtest_discover_tests(miniffs_test
|
||||
WORKING_DIRECTORY ${PROJECT_DIR}
|
||||
PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_DIR}"
|
||||
)
|
||||
7
test/fs_opening.cpp
Normal file
7
test/fs_opening.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
/******************************************************************************
|
||||
* MiniFFS : Mini Flat File System
|
||||
* This file is part of the test suite of MiniFFS
|
||||
*
|
||||
* Copyright (c) 2008-2022 986-Studio. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
Reference in New Issue
Block a user