diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-02 19:51:54 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:57:00 +0200 |
commit | eecf4b1e666211a13afa56f93477c55e8fd01621 (patch) | |
tree | 410510d6e058995174d5a5b0f535fb457a0c3542 /test/CMakeLists.txt | |
parent | 87f55120f96d0f4f80b497dc9006d89df2dda125 (diff) |
feat: implement game of lifev0.1.0
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r-- | test/CMakeLists.txt | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 243c1dd..0c74bf2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,18 +1,20 @@ +project(tests CXX) + +enable_testing() + file(GLOB SOURCES - main.cpp - string_matrix.test.cpp - "function.test.cpp" + cell_helper_test.cpp + ${CMAKE_SOURCE_DIR}/src/game/cell_helper.cpp ${CMAKE_SOURCE_DIR}/src/engine/data/vector2.cpp ${CMAKE_SOURCE_DIR}/src/engine/data/bounds.cpp - ${CMAKE_SOURCE_DIR}/src/engine/graphics/string_matrix.cpp ) -add_executable(tests ${SOURCES}) +add_executable(${PROJECT_NAME} ${SOURCES}) -target_compile_features(tests PUBLIC cxx_std_20) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) target_compile_options( - tests + ${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Wshadow -Wold-style-cast -Wcast-align -Wno-unused @@ -26,21 +28,22 @@ target_compile_options( -pedantic -fsanitize=address -fno-exceptions ) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - target_compile_options( - tests - PRIVATE - -Wlogical-op -Wnoexcept -Wstrict-null-sentinel - ) -endif() - target_include_directories( - tests + ${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/src" - "${CMAKE_SOURCE_DIR}/test" ) -target_link_libraries(tests GSL doctest) +target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address) + +target_link_libraries( + ${PROJECT_NAME} + GSL + yacppdic + gtest_main + gmock +) + +include(GoogleTest) -target_link_options(tests PRIVATE -fsanitize=address) +gtest_discover_tests(${PROJECT_NAME}) |