Add custom fseek and fread
Add test framework gtest and added my custom fread and fseek tests + functions
This commit is contained in:
2023-11-12 14:33:15 +01:00
committed by Sander Speetjens
parent d436447a21
commit 7c76a37ec9
7 changed files with 212 additions and 8 deletions

28
tests/CMakeLists.txt Normal file
View File

@@ -0,0 +1,28 @@
find_package(GTest REQUIRED)
# Third Party
include_directories(${GTEST_INCLUDE_DIR})
link_directories(${GTEST_LIB_DIR})
# tests
file(GLOB_RECURSE TEST_SOURCES "*.cpp")
add_executable(tests ${TEST_SOURCES})
target_compile_options(tests PRIVATE $<$<CONFIG:Debug>:
-Wall -Wextra -pedantic-errors -Wconversion -Wsign-conversion
>)
target_link_libraries(tests
PRIVATE
gtest
GTest::gtest_main
)
target_include_directories(tests
PUBLIC
${CMAKE_CURRENT_LIST_DIR}
${PROJECT_BINARY_DIR}
)
include(GoogleTest)
gtest_discover_tests(tests)