aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt41
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})