Add initial libraries and their respective test code

This commit is contained in:
2023-11-04 12:51:01 +01:00
parent fc2258ce10
commit 75b8cfe46b
12 changed files with 931 additions and 0 deletions

34
tests/CMakeLists.txt Normal file
View File

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